Search code examples
iosweatheriphone-6

How to get barometric pressure iOS


From what I know, the new iPhone 6/Plus have a barometer that will give us the value of the air pressure. How do I do this? There's little resources I can find.


Solution

  • It is part of the Core Motion Framework. It exposes two new class CMAltimeter and CMAltitudeData which you can use to determine the barometric pressure.

    Core Motion provides two new classes (CMAltimeter and CMAltitudeData) which allow you to access the barometer on the iPhone 6 and iPhone 6 Plus. On these two devices, you can also use a CMMotionActivity object to determine whether the user is on a bicycle.

    Source: Apple Developer Center