IOS creates tab bar through code

From , 5 Years ago, written in Objective-C, viewed 118 times.
URL https://pastebin.vip/view/e0308d73
  1. self.tableViewController =[[TableViewController alloc] initWithNibName:@"TableViewController" bundle:nil];
  2. self.viewController = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
  3.  
  4. self.tableViewController.title  =@"Table Usage";
  5. self.viewController.title       =@"View Usage";
  6.  
  7.  
  8. self.tabBarController= [[UITabBarController alloc] init];
  9.  
  10. NSMutableArray *controllers=[[NSMutableArray alloc] initWithCapacity:2];
  11. [controllers addObject:self.tableViewController];
  12. [controllers addObject:self.viewController];
  13.  
  14.  
  15. self.tabBarController.viewControllers =controllers;
  16. [self.window addSubview:self.tabBarController.view];
  17. //objectc/5846

Reply to "IOS creates tab bar through code"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website