StuStirling
StuStirling

Reputation: 16191

Rotating MapView in iOS6 on User Gesture

It seems you cannot rotate the map view using user's two finger gesture anymore. It has been a while since I did any iOS development but pre-ios6 it was automatically enabled.

Is this the case or is it me being ridiculous? It seems to me that its a very basic requirement for developers to be able to allow their users to rotate the map.

Any links to documentation that specifically says we can't rotate or some clarification would be much appreciated.

Upvotes: 1

Views: 326

Answers (1)

Madhumitha
Madhumitha

Reputation: 3824

Try UIRotationGestureRecognizer to rotate map.Following code will help you.

   UIRotationGestureRecognizer *rgrr = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotateMap:)];
[mapView addGestureRecognizer:rgrr];//mapView -->your mapview
rgrr.delegate = self;

////////

- (void) rotateMap:(UIRotationGestureRecognizer *)gestureRecognizer{
gestureRecognizer.view.transform = CGAffineTransformRotate(gestureRecognizer.view.transform, gestureRecognizer.rotation);
gestureRecognizer.rotation = 0; }

Upvotes: 1

Related Questions