Question: I'm trying to set the font weight of a selected tab bar item to bold font. It seems as it has no effect. Any idea what is wrong. `forState: .Normal` works as expected, `forState: .Selected` has no effect.

```
let tabBarItem0 = tabBar.items![0] as! UITabBarItem
var selectedImage0 : UIImage = UIImage(named:"ic_tabbar_item_one")!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
var fontLight:UIFont = UIFont(name: "HelveticaNeue-UltraLight", size: 12)!
var fontBold:UIFont = UIFont(name: "HelveticaNeue-Bold", size: 12)!

tabBarItem0.image = unselectedImage0
tabBarItem0.selectedImage = selectedImage0
tabBarItem0.title = "Overview"
tabBarItem0.setTitleTextAttributes(
    [
        NSForegroundColorAttributeName: UIColor.whiteColor(),
        NSFontAttributeName: fontLight
    ], forState: .Normal)

tabBarItem0.setTitleTextAttributes(
    [
        NSForegroundColorAttributeName: UIColor.whiteColor(),
        NSFontAttributeName: fontBold
    ], forState: UIControlState.Selected)

```

Answer: 
I've faced the same issue when tried to change font of selected item. Looks like titleTextAttributes' font parameter is only useful when setting them to normal state. That's why I implemented `UITabBarControllerDelegate` where I update attributes for currently selected item. You should call `updateSelection()` method after `UITabBarController`s `loadView()` too. Or you can call `updateSelection()` method in overridden `selectedItem` setter.

```
extension TabBarController: UITabBarControllerDelegate {

  func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
    updateSelection()
  }

  func updateSelection() {
    let normalFont = Fonts.Lato.light.withSize(10)
    let selectedFont = Fonts.Lato.bold.withSize(10)
    viewControllers?.forEach {
      let selected = $0 == self.selectedViewController
      $0.tabBarItem.setTitleTextAttributes([.font: selected ? selectedFont : normalFont], for: .normal)
    }
  }

}

```
The problem is that the state of `tabBarItem0` is not changed to `Selected`. Because this is `UITabBarItem` which represents a single element of a `UITabBar`. So, you can not directly change the status using `UITabBarItem` API. You have to change it state by assigning `selectedItem`.

This information is gained from documentation and I suggest all programmers to have skills like this. Hopefully, this will help.