I am using a MapView in my app to show some annotations. In iOS 7 a compass appears randomly on the map. I can't reproduce the error because it appears randomly but I want to disable it. Any ideas how to disable it?
Update: I found out is not appears randomly but on a specific gesture. When you use 2 fingers and slide one right and the other left.
Create a wrapper
UIView
with the frame you want for your map andclipsToBounds
set toYES
(or equivalently, Clip Subviews set in Interface Builder). Then put yourMKMapView
inside that wrapper view, with the y co-ordinate of the map's frame set to, for example,-80
, and the height of the map set such that its vertical center is aligned with its parent.Then the compass will be displayed but you cannot see it, because it is above the top of its parent view - problem solved.
Here is solution for Swift 4: