I have built my app using new Xcode 9 beta for ios 11. I have found an issue with UITabBar where items are spread through the UITabBar and title is right aligned to the imag
Swift 4 version with a subclass that avoids extension/category naming collision:
class TabBar: UITabBar {
override var traitCollection: UITraitCollection {
guard UIDevice.current.userInterfaceIdiom == .pad else {
return super.traitCollection
}
return UITraitCollection(horizontalSizeClass: .compact)
}
}
If you use Interface Builder and storyboards, you can select the tab bar view in your UITabBarController
scene and change its class to TabBar
in the Identity Inspector: