title: Customizing Left & Right UISegmentedControl Buttons
body: <p>I'm trying to customize the following segmented control, using a left image for the first button and a right image for the second button. How would I do this using UIAppearance?</p>
  
  <p>I want to change the following segmentedControl:</p>
  
  <p><img src="https://i.stack.imgur.com/QhHap.png" alt="enter image description here"></p>
  
  <p>to something similar like below:</p>
  
  <p><img src="https://i.stack.imgur.com/VCtFR.png" alt="enter image description here"></p>
  
  <p>The reason I want to use a custom image is so that I can change the corners of the buttons. If you look at the blue segmented control, it's more squared (my image has it's own corners).</p>
  
  <p>I was thinking of something like this but no use:</p>
  
  <pre><code>UIImage *leftImage = [[UIImage imageNamed:@"leftControl.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];
  UIImage *rightImage = [[UIImage imageNamed:@"rightControl.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];
  
  [[UISegmentedControl appearance] setBackgroundImage:leftImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault ];
  [[UISegmentedControl appearance] setBackgroundImage:rightImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
  </code></pre>