title: Customizing tint color of UIBarButtonSystemItem with UIAppearance API
body: <p>I know I can customize the <code>UIBarButtonItem</code> text via</p>
  
  <pre><code>setTitleTextAttributes:forState:
  </code></pre>
  
  <p>There is also a way to customize <code>UITabBar</code> icons via</p>
  
  <pre><code>setSelectedImageTintColor:
  </code></pre>
  
  <p>Is there a way to customize the tint color of a <code>UIBarButtonSystemItem</code>, (e.g. the trash icon color), just to have a consistent UX? I could not find anything.</p>
  
  <p>If this is not possible, how would I proceed? Should I save a color modified version of the icon? Where can I find it? What would be the easiest way to modify it?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>To clarify, it's not the background color of the <code>UIBarButtonItem</code> I am asking for, but the color of the contour of the icon.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Setting the tint color of the <code>UIBarButtonItem</code> yields the background color of the button set.</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
      self.window.backgroundColor = [UIColor whiteColor];
      [self.window makeKeyAndVisible];
  
  
      [[UINavigationBar appearance] setTintColor:[UIColor greenColor]];
  
      UIBarButtonItem* trashButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:nil action:nil];
  
      trashButton.tintColor = [UIColor blackColor];
      UIViewController* viewController = [[UIViewController alloc] init];
      UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:viewController];
      [viewController.navigationItem setRightBarButtonItem:trashButton];
  
      self.window.rootViewController = navController;
      return YES;
  }
  </code></pre>
  
  <p>yields <a href="https://www.dropbox.com/s/yis6z5j3wzamdmm/Untitled.png">this</a>.</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>It turns out that the contour color of the system icons in fact can be set via <code>tintColor</code> property of <code>UIBarButtonItem</code>, however only if its <code>style</code> property has the value <code>UIBarButtonItemStylePlain</code>. (Even then, some colors are special and leave the contour white. One such color is <code>[UIColor blackColor]</code>) However, using the <code>UIBarButtonItem</code> in a <code>UINavigationBar</code> the <code>style</code> is forced to be <code>UIBarButtonItemStyleBordered</code>. In this case, <code>tintColor</code> sets the background color of the button and leaves the contour white.</p>
  
  <p>As I am using the <code>UIBarButtonItem</code>s in a navigation bar, my problem still remains unsolved.</p>