I am trying to implement a UITabBarController
with 2 UITabBarItems
. I added a TabBarController to the storyboard. I almost did it, but still I am blocked by two important issues:
1) Here is what the tab bar looks like: 
Please ignore the orange button, which is not a tabItem. So I put 2 tabItems, and I want to keep white images for both tabs, even if one of them is selected. I checked tintColor
, barTintColor
many times and did not succeed.
Also I tried setting tabBarItem in ViewController:
override func awakeFromNib() { super.awakeFromNib() let imgHome = UIImage(named: "btnHome")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal) let imgProfile = UIImage(named: "btnProfile")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal) let imgSelectedTab = UIImage(named: "selectedTab_imgBackground")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal) tabBarItem = UITabBarItem(title: nil, image: imgProfile, selectedImage: imgSelectedTab) }
but without success. Any thoughts on this issue?
2) The second question concerns the selectedImage
property of the UITabBarItem
class. image width
does not match tab. I switched between devices, and for each device, the selected image moved through another tab or does not correspond to the current tab. (I found a solution: to have the same image, but with a different width for each device. Not a good solution)


Any help would be ok! Thank you very much
source share