首页 > 其他 > 详细

OC--初始化UINavigationController

时间:2015-10-15 14:24:32      阅读:244      评论:0      收藏:0      [点我收藏+]

 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

  // create a navigation controller and perform some simple styling

  self.navigationController = [UINavigationController new];

  self.navigationController.navigationBar.barTintColor = [UIColor darkGrayColor];

  [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];

  

  // create and navigate to a view controller

  UIViewController *viewController = [self createInitialViewController];

  [self.navigationController pushViewController:viewController animated:NO];

 

  // show the navigation controller

  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

  self.window.rootViewController = self.navigationController;

  [self.window makeKeyAndVisible];

  return YES;

}

 

- (UIViewController *)createInitialViewController {

  self.viewModelServices = [[RWTViewModelServicesImpl alloc] initWithNavigationController:self.navigationController];

  self.viewModel = [[RWTFlickrSearchViewModel alloc]

                    initWithServices:self.viewModelServices];

  return [[RWTFlickrSearchViewController alloc]

          initWithViewModel:self.viewModel];

}

OC--初始化UINavigationController

原文:http://www.cnblogs.com/SimonGao/p/4882192.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!