码迷,mamicode.com
首页 > 其他好文 > 详细

蓝懿教育 生命周期 删掉storyboard

时间:2015-10-29 21:38:37      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:

生命周期顺序

 

//1-(void)loadView                                                     加载内存 

//2-(void)viewDidLoad                                               加载完成 

//3-(void)viewWillAppear:(BOOL)animated               页面将要渲染到屏幕上 

//4-(void)viewDidAppear:(BOOL)animated               页面已经渲染        

//5-(void)viewWillDisappear:(BOOL)animated          页面将要消失        

//6-(void)viewDidDisappear:(BOOL)animated           页面已经消失        

//7-(void)didReceiveMemoryWarning                        内存紧张    

 

 

删掉storyboard、ViewController;删掉info里的storyboard。

AppDelegate里:

//初始化window

    self.window = [[UIWindow alloc]init];

    //初始化左侧边栏控制器

    SGLeftMenuViewController *lvc = [[SGLeftMenuViewController alloc]initWithNibName:@"SGLeftMenuViewController" bundle:nil];

    //初始化主视图控制器

    MainViewController *mvc       = [[MainViewController alloc]initWithNibName:@"MainViewController" bundle:nil];

    //添加导航栏

    UINavigationController *nc    = [[UINavigationController alloc]initWithRootViewController:mvc];

    //添加侧栏管理器 同时将设置侧边栏控制器和主视图控制器

    MMDrawerController *dc        = [[MMDrawerController alloc]initWithCenterViewController:nc leftDrawerViewController:lvc];

    

    //使得侧边栏持有首页,及侧边栏管理器

    lvc.mainNvc = nc;

    

    lvc.mmd = dc;

    

    //设置侧边栏属性

    //设置左侧边栏宽度

    [dc setMaximumLeftDrawerWidth:240.0];

    //设置打开左侧边栏模式

    [dc setOpenDrawerGestureModeMask:MMOpenDrawerGestureModePanningCenterView];

    //设置关闭左侧边栏模式

    [dc setCloseDrawerGestureModeMask:MMCloseDrawerGestureModePanningCenterView];

    //弹出动画速度

    [dc setAnimationVelocity:10000];

    

    [dc setShouldStretchDrawer:NO];

    

    //设置window的根视图控制器

    self.window.rootViewController = dc;

    

//    lvc.view.backgroundColor = [UIColor blueColor];

    

    [self.window makeKeyAndVisible];

蓝懿教育 生命周期 删掉storyboard

标签:

原文地址:http://www.cnblogs.com/stuyingiOS/p/4921792.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!