I created a UITabBarController class
I created two view controllers and set the title property for each one
I want to change the size and the color of text label within the tabs
I already set the tab color and frame using
UITabBar.appearance().barTintColor = UIColor.blueColor()
tabBar.frame = CGRectMake(0, 0, view.frame.width, 100)
Now for adjusting the tabs, I tried each of the following
UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object: UIColor.whiteColor(), forKey: NSForegroundColorAttributeName), forState: UIControlState.Normal)
That changed the text color to white
UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object: UIColor.whiteColor(), forKey: NSForegroundColorAttributeName), forState: UIControlState.Normal)
UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(object: UIFont(name: "Helvetica", size: 16.0)!, forKey: NSFontAttributeName), forState: UIControlState.Normal)
That only changed the size of the text, not the color !
UITabBarItem.appearance().setTitleTextAttributes(NSDictionary(objects: [NSForegroundColorAttributeName, NSFontAttributeName], forKeys: [UIColor.whiteColor(), UIFont(name: "Helvetica", size: 16.0)!]), forState: UIControlState.Normal)
// OR
var attributes = NSDictionary(objects: [NSForegroundColorAttributeName, NSFontAttributeName], forKeys: [UIColor.whiteColor(), UIFont(name: "Helvetica", size: 16.0)!])
UITabBarItem.appearance().setTitleTextAttributes(attributes, forState: UIControlState.Normal)
That last bit did nothing at all, neither setting the color nor the size of the tabs text
Update------
To be more precise, the above code is all tried within the UITabBarController child class in viewWillAppear
Furthermore, I was curious about how to make the whole tabs (tab-able) and not only the text label part of it, and also add some sort of a line separator between the tabs