Objective c iOS-增加部分卷曲抽头区域以消除模态

Objective c iOS-增加部分卷曲抽头区域以消除模态,objective-c,ios,partial-views,modalviewcontroller,Objective C,Ios,Partial Views,Modalviewcontroller,有办法做到这一点吗?就像轻敲屏幕的任何部分一样,会消除部分模态旋度。 我想到了一个不可见的按钮,但它仍然不能覆盖整个卷曲区域。在viewDidLoad UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self ac

有办法做到这一点吗?就像轻敲屏幕的任何部分一样,会消除部分模态旋度。
我想到了一个不可见的按钮,但它仍然不能覆盖整个卷曲区域。

viewDidLoad

UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
                                                                                action:@selector(getDismissed)];

UISwipeGestureRecognizer *swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self 
                                                                                action:@selector(getDismissed)];
swipeRecognizer.direction = UISwipeGestureRecognizerDirectionDown;
tapRecognizer.numberOfTapsRequired = 1;
tapRecognizer.numberOfTouchesRequired = 1;
tapRecognizer.delegate = self;
[self.view addGestureRecognizer:tapRecognizer];
[self.view addGestureRecognizer:swipeRecognizer];

-(void)getDismissed
{
    // call dismissViewControllerAnimated:completion: by the presenting view controller
    // you can use delegation or direct call using presentingViewController property
}
然后排除,因为你不想引发解雇

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
    // touching objects of type UIControl will not dismiss the view controller
    return ![touch.view isKindOfClass:[UIControl class]];
}

非常感谢。我很久以前就需要这个了。但我期待着下一次的使用