title: Position 2 UITabBarItem to left and right of screen, with void in the middle
body: <p>Is there a way to position 2 <code>UITabBarItem</code> to the left and right of a <code>UITabBarController</code> and leave space in the middle as if there was 2 &quot;unused&quot; items? <code>itemPositioning</code>, <code>itemWidth</code> and <code>itemSpacing</code> don't seem to work that way.</p>
  <p>The code below just splits the entire width of the screen in two equal parts, and position each item in the middle of its respective half:</p>
  <pre><code>class MainController: UITabBarController {
     override func viewDidLoad() {
        super.viewDidLoad()
                  
        let vcOne = UIViewController()
        let vcTwo = UIViewController()
      
        let itemOne = UITabBarItem()
        itemOne.image = UIImage(named: &quot;imgOne&quot;)
  
        let itemTwo = UITabBarItem()
        itemOne.image = UIImage(named: &quot;imgTwo&quot;)
  
        vcOne.tabBarItem = itemOne
        vcTwo.tabBarItem = itemTwo
      
        tabBar.itemPositioning = .centered
        tabBar.itemWidth = UIScreen.main.bounds.width / 4
        tabBar.itemSpacing = UIScreen.main.bounds.width / 2
     }
  }
  </code></pre>
  <p>I'm basically looking for something like this:</p>
  <p><a href="https://i.stack.imgur.com/674Av.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/674Av.png" alt="enter image description here" /></a></p>
  <p>I guess I could use <code>UIEdgeInsets</code> but I'm looking for something more reliable to match the position of items in the same <code>UITabBar</code>, should it hold 4 items instead of 2.</p>