2

I am using a basic iPad Master Table Application that uses portrait orientation only.

I wish to stop the masterviewcontroller from appearing when you swipe right (making accessible by only the button).

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63

1 Answers1

4

This is a new feature of UISplitViewController that was introduced in iOS 5.1.

In order to disable this feature, they also implemented a new property called presentsWithGesture to turn it on and off.

Apple highly recommends that you leave it on as people will grow to expect it to work this way, but if you must disable it, somewhere in your code you will need to add this:

self.splitViewController.presentsWithGesture = NO; 

Or, if you are creating the splitViewController manually then just set the presentsWithGesture to NO.

lnafziger
  • 25,760
  • 8
  • 60
  • 101
  • Makes sense regarding Apple's recommendation, however one situation where this would seem useful is if you want your detail view to respond to the swipe gesture instead. I have this situation in an app I am building because the detail view contains a map where the user can pan by swiping in any direction…but if they swipe right the Master view slides in from the left instead. So I used this property to turn the feature off so the map could be panned naturally in all directions. By the way I set this in the AppDelegate, application:didFinishLaunchingWithOptions: ... – Dave Marley Mar 22 '12 at 13:59
  • Thanks for that "I set it in the AppDelegate" tip, Dave. I tried putting it elsewhere in my code and it was completely ignored. Now, finally, right-swiping works again ! – Mike Gledhill Jul 13 '12 at 13:19