开发者

iOS - Open/Show view swiping down from navigation bar

开发者 https://www.devze.com 2023-04-05 07:10 出处:网络
i would like to know if is possible open/show a new view swiping down ( or up ) from the navigation bar, just like the notification cente开发者_如何学编程r view in iOS 5 ( it appear from status bar, a

i would like to know if is possible open/show a new view swiping down ( or up ) from the navigation bar, just like the notification cente开发者_如何学编程r view in iOS 5 ( it appear from status bar, and i think this isn't possible for normal apps, right? ). Thanks :)


You have to use UISwipeGestureRecognizer. Here's the code :

UISwipeGestureRecognizer *swipeUp=[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(youSelector:)];
[swipeUp setNumberOfTouchesRequired:2];
[swipeUp setDirection:UISwipeGestureRecognizerDirectionUp];
[yourView addGestureRecognizer:swipeUp];
0

精彩评论

暂无评论...
验证码 换一张
取 消