OC-SB的使用

1.创建storyBoard

截屏2023-10-30 15.14.56.png

截屏2023-10-31 11.57.37.png

2.关联视图控制器

截屏2023-10-31 11.59.05.png
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   
    //创建Window
    _window = [[UIWindow alloc] initWithFrame: [UIScreen mainScreen].bounds];
    _window.backgroundColor = [UIColor whiteColor];
    [_window makeKeyAndVisible];
    
    //加载Storyboard(Main是文件名)
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    //(->)入口的控制器
    FirstTabBarController *first = [sb instantiateInitialViewController];
    //根据id关联并创建sb中的FirstTabBarController(指定的)
//    FirstTabBarController *first = [sb instantiateViewControllerWithIdentifier:@"FirstTabBarController"];
    
    //指定根控制器
    _window.rootViewController = first;
    
    return YES;
}

1.添加导航控制器和标签控制器

截屏2023-10-26 16.09.29.png

2.添加控件

截屏2023-10-26 16.10.03.png

3.一个标签控制器可以关联四个导航控制器

截屏2023-10-26 16.11.25.png

截屏2023-10-26 16.10.52.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容