答案 0 :(得分:0)
您可以使用UISwipeGestureRecognizer(向下)来实现此行为。
使用以下代码向模型视图添加手势:
UISwipeGestureRecognizer *downGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(downGestureHandler:)];
[gestureRecognizer setDirection:(UISwipeGestureRecognizerDirectionDown)];
[self.view addGestureRecognizer: downGestureRecognizer];
关闭模型视图的方法:
-(void) downGestureHandler:(UISwipeGestureRecognizer *)recognizer {
//Code to dismiss model view with animation
}