1

I want to dismiss a modal view with dragging down photo like twitter app's photo views.

I found same issue, but it written in Swift.

I need Object-C version.

enter image description here

dobiho
  • 1,025
  • 1
  • 11
  • 22

1 Answers1

0

You can use UISwipeGestureRecognizer (Down) to achieve the behaviour.

Add gesture to the model view using below code:

UISwipeGestureRecognizer *downGestureRecognizer = [[UISwipeGestureRecognizer   alloc] initWithTarget:self action:@selector(downGestureHandler:)];
[gestureRecognizer setDirection:(UISwipeGestureRecognizerDirectionDown)];
[self.view addGestureRecognizer: downGestureRecognizer];

The method to dismiss the model view:

-(void) downGestureHandler:(UISwipeGestureRecognizer *)recognizer {

        //Code to dismiss model view with animation
}
iOS
  • 5,450
  • 5
  • 23
  • 25