欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iOS跳转方法(带demo)

程序员文章站 2022-06-08 18:15:55
...

iOS跳转方法(带demo)

主要有三种跳转方式:

1.改变根视图

self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen] .bounds];
one *jump1 = [[one alloc] init];
[UIApplication sharedApplication].keyWindow.rootViewController = jump1;

2.模态弹出

two *jump2 = [[two alloc] init];
[self presentViewController:jump2 animated:YES completion:nil];

3.用 UINavigationController跳转

three *jump3 = [[three alloc] init];
[self.navigationController pushViewController:jump3  animated:YES];

demo:
iOS跳转方法(带demo)

下载地址:

链接:https://pan.baidu.com/s/1GdFEEEg0DB-qyP9_vkG4xA 密码:rjfq

相关标签: iOS 跳转