Search code examples
objective-cipaduiimageviewuisplitviewcontroller

Prevent the Master View to be shown when dragging UIimageView close to it in a iPad SplitView Application


My IPAD application is a kind of a game in which the user has to set the images in the right order.

For example, there are four fairy tale images that have to be rearranged in the right order basing on what comes first and last in the story.

If i drag the image close to the Master View when i'm running in landscape or portrait mode the event which opens the master view is firing and hiding my image behind the Mater View.

I searched all around and I did not find anything which stops this master view to be shown when i drag a finger from left to right.

The detail view always have to be shown because the user can't lose focus, so always show the Master View is not a solution.

Is there a way to disable/prevent the master view to open when touching the screen from left to right like I described?

I tried to post a screenshot here but I have no reputation to do that, sorry.


Solution

  • As CodaFi answered up there, I must set the presentsWithGesture attribute when creating my splitview like below:

    if ([splitViewController respondsToSelector:@selector(setPresentsWithGesture:)])
        [splitViewController setPresentsWithGesture:NO];
    

    It prevent the swipe gesture to open the master view.