您的位置:首页 > 移动开发 > IOS开发

iOS - Swipe to pop效果

2016-10-09 11:03 197 查看

自动实现

iOS 7以上,只要是符合系统的导航结构:

1.代码

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.navController = [[[UINavigationController alloc] initWithRootViewController:self.viewController] autorelease];
self.window.rootViewController = self.navController;
[self.window makeKeyAndVisible];
return YES;
}


2.Storyboard

主体由一个UINavigationController引入。

均能拥有Swipe to pop的效果:



手动用UIScreenEdgePanGestureRecognizer手势实现

留坑,一会儿代码写好,来更
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios pop swipe 导航 手势