How to use custom UITabBarItem images from Apple?

Apple introduced an example View Controller Programming Guide for creating a UITabBarItem, for example:

- (id)init {
   if (self = [super initWithNibName:@"MyViewController" bundle:nil]) {
      self.title = @"My View Controller";

      UIImage* anImage = [UIImage imageNamed:@"MyViewControllerImage.png"];
      UITabBarItem* theItem = [[UITabBarItem alloc] initWithTitle:@"Home" image:anImage tag:0];
      self.tabBarItem = theItem;
      [theItem release];
   }
   return self;
}

However, I am a noob graphic and want to use Apple's embedded graphics for tab bar items. How could I do this? Where is the list of available icons and their names?

+3
source share
1 answer

Use - (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tagto create a UITabBarItem.
For possible values ​​of UITabBarSystemItem, see the link to the UITabBarItem class, section "Constants".

+8
source

Source: https://habr.com/ru/post/1730043/


All Articles