title: I need to add a custom tabbar controller in appdelegate swift
body: <pre><code> UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
  UITabBar *tabBar = tabBarController.tabBar;
  UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
  UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1];
  UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2];
  UITabBarItem *tabBarItem4 = [tabBar.items objectAtIndex:3];
  
  tabBarItem1.title = @"Home";
  tabBarItem2.title = @"Maps";
  tabBarItem3.title = @"My Plan";
  tabBarItem4.title = @"Settings";
  
  [tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"home_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"home.png"]];
  [tabBarItem2 setFinishedSelectedImage:[UIImage imageNamed:@"maps_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"maps.png"]];
  [tabBarItem3 setFinishedSelectedImage:[UIImage imageNamed:@"myplan_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"myplan.png"]];
  [tabBarItem4 setFinishedSelectedImage:[UIImage imageNamed:@"settings_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"settings.png"]];
  
  
  // Change the tab bar background
  UIImage* tabBarBackground = [UIImage imageNamed:@"tabbar.png"];
  [[UITabBar appearance] setBackgroundImage:tabBarBackground];
  [[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"tabbar_selected.png"]];
  
  // Change the title color of tab bar items
  [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                     [UIColor whiteColor], UITextAttributeTextColor,
                                                     nil] forState:UIControlStateNormal];
  UIColor *titleHighlightedColor = [UIColor colorWithRed:153/255.0 green:192/255.0 blue:48/255.0 alpha:1.0];
  [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                     titleHighlightedColor, UITextAttributeTextColor,
                                                     nil] forState:UIControlStateHighlighted];
  
  
  return YES;
  </code></pre>
  
  <p>I have found this code in objective C. I need the same thing in swift. How can I get this. Please help as I am new to iOS.</p>
  
  <p>I am trying to create a custom tabbar using swift.The above code is objective c code written in appdelegate.</p>