The cameras in your iPhone take great photos even in difficult conditions. If you accidentally move a camera when you take a picture, the resulting image can be blurry. To prevent this, some iPhone models have optical image stabilization (OIS).* OIS lets you take sharp photos even if you accidentally move the camera.
A gyroscope senses that the camera moved. To reduce image motion, and the resulting blur, the lens moves according to the angle of the gyroscope. Magnetic sensors determine the lens position so that the compensating motion can be set accurately.
* OIS is available on iPhone X, iPhone 8, iPhone 8 Plus, iPhone 7, iPhone 7 Plus, iPhone 6 Plus, and iPhone 6s Plus.
A strong magnetic field can interfere with OIS
Lens-position sensors respond to magnetic fields. If you place a magnet near these sensors, the magnetic field will interfere with the sensors. This can degrade the sensors' accuracy and limit the range of movement available to the lenses. Severe interference can disable OIS. The camera will continue to take photos with other means of stabilization but without the benefit of OIS.
How to avoid magnetic interference
Third-party manufacturers make some accessories with strong magnets or magnetizable metal plates that are near the iPhone rear camera (or cameras). These magnets and plates can latch folio covers, join separable cases, or attach to rigid mounts—for example, car mounts. Apple recommends that third-party manufacturers avoid using magnets and metal components in cases and other accessories. For best camera performance on an iPhone with OIS, avoid accessories that use magnets or metal.
If your camera still isn't working
If you removed your iPhone case and any other magnetic accessories and your iPhone camera still isn't working, find out what to do.