0

I have a UITabBar with 4 UITabBarItems and each item have an image and a selectedimage.

Normally I want to have that :

enter image description here

But on first launch, the app displays all selected images :

enter image description here

Then, if I kill the app, I have the good state (first image). Why ?

EDIT :

This is a screen of my interface builder : enter image description here

Rishil Patel
  • 1,977
  • 3
  • 14
  • 30
BSK-Team
  • 1,750
  • 1
  • 19
  • 37

2 Answers2

0
  • First double check your selected images on your Storyboard are correct or not.
  • Take a look at Image Tint color in your Tabbar and change it to white/clear color.

enter image description here

Canh Tran
  • 298
  • 1
  • 14
0

I found the problem. There were this lines in the code and they make a conflict :

for item in tabBarController.tabBar.items! {
   item.image = item.selectedImage?.imageWithColor(tintColor: UIColor(hex: "#777777")).withRenderingMode(.alwaysOriginal)
}

I just deleted them and it worked.

BSK-Team
  • 1,750
  • 1
  • 19
  • 37