perfected per pixel collision detection on iOS device