iOS 屏幕边缘侧滑返回

2021-08-26  本文已影响0人  anny_4243
UIScreenEdgePanGestureRecognizer *screenEdgeRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(screenEdgeDetected:)];
/*设置边缘起点*/
screenEdgeRecognizer.edges = UIRectEdgeLeft;
[self.view addGestureRecognizer: screenEdgeRecognizer];
- (void)screenEdgeDetected:(UIScreenEdgePanGestureRecognizer *)screenEdge
{
    [self dismissViewControllerAnimated:YES completion:nil];
}
上一篇 下一篇

猜你喜欢

热点阅读