Rounded corners for UITabBar
<p>I would like to create a UITabBar with rounded corners. Is there a way I can make the UITabBar have rounded corners? It would take the shape of the second picture.</p>
<p>The app starts off with a tableView. When the user taps a topic, they are sent to a tabBar controller.</p>
<p><a href="https://i.stack.imgur.com/Buf50.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Buf50.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/9OvPo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9OvPo.jpg" alt="This is the shape I want it to take" /></a></p>
<p>-----edit-----</p>
<p>This is my AppDelegate:</p>
<pre><code>func application(_application: UIApplication,
willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -&gt; Bool{

    let tabBarController = window?.rootViewController as! UITabBarController
    let image = UIImage(named: &quot;bar&quot;)
    let tabBarImage = resize(image: image!, newWidth: tabBarController.view.frame.width)
    tabBarController.tabBar.backgroundImage = tabBarImage
    

    return true
}

func resize(image: UIImage, newWidth: CGFloat) -&gt; UIImage {

UIGraphicsBeginImageContext(CGSize(width: newWidth, height: image.size.height))
image.drawInRect( CGRect(x: 0, y: 0, width: newWidth, height: image.size.height))
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()

return newImage!
}
</code></pre>
<p><a href="https://i.stack.imgur.com/wkkjI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wkkjI.png" alt="enter image description here" /></a></p>
<p>Edit: Dec '21
Replaced image to omit name on project.</p>