Can somebody tell me please how can I move title of UITabBarItem for example 2px to top?
Swift 4 Like me, if you are creating tab bar controller inside some other controller just after adding all controller you can loop through the tab bar items and change title and positioning and font
for (index,tabBarItem) in tabBarController.tabBar.items!.enumerated() {
tabBarItem.image = nil //if you only want title and no Image
tabBarItem.title = titleArray[index] //setting your title based on some array
let attributes = [NSAttributedStringKey.font: UIFont.systemFont(ofSize: 20)] // changeing font and height of the text
tabBarItem.setTitleTextAttributes(attributes, for: .normal)
tabBarItem.titlePositionAdjustment = UIOffset(horizontal: 0, vertical: -10.0) // updating the title positon
}