Simple map app which turns as phone is rotated (z axis)) Uses Swift 3
After launching the app an interactive mapView loads. Pressing "MapFixed" button toggles it to "MapRotates". CoreMotion is then turned on. The top of the iPhone (where the camera is, i.e. opposite home button when phone is held with back facing the ground) now acts like a compass (aligned with needle image) pointing in the correct direction relative to the map.