YouTip LogoYouTip

Att Ios Ui Tab Bar

## Using iOS Tab Bar It is typically used to switch between subtasks, views, or models within the same view. An example of a tab bar is shown below: ![Image 3: tabBar](#) Important Properties * backgroundImage * items * selectedItem Sample Code and Steps 1. Create a new project, select **Tabbed Application** instead of a view application, click Next, enter the project name, and select **Create**. 2. By default, two view controllers and a tab bar are created and added to our application. 3. The **AppDelegate.m didFinishLaunchingWithOptions** method is as follows: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [ initWithFrame:[ bounds]]; // Override point for customization after application launch. UIViewController *viewController1 = [ initWithNibName:@"FirstViewController" bundle:nil]; UIViewController *viewController2 = [ initWithNibName:@"SecondViewController" bundle:nil]; self.tabBarController = [ init]; self.tabBarController.viewControllers = @[viewController1, viewController2]; self.window.rootViewController = self.tabBarController; [self.window makeKeyAndVisible]; return YES;} 4. Two view controllers are assigned as the tab bar controller’s view controllers. 5. Run the application to get the following result: ![Image 4: tabBarOutput](#)
← Att Ios Ui ImageviewAtt Ios Ui Navigation Bar β†’