codepath / ios_guides

Comprehensive open-source iOS guides
http://guides.codepath.com/ios
2.88k stars 473 forks source link

Custom Tab Bar problem #57

Closed ghost closed 6 years ago

ghost commented 7 years ago

First of all, thanks a lot for this great topic. it was really helpful for me. My problem concerns the buttons[previousIndex].isSelected = false the button state keeps the selected style... At the end of my navigation, almost all my buttons have the "selected" look. If you have any tip or solution to correct this problem, please tell me. thanxs !

ghost commented 7 years ago

ok, i solved my problem. it was due to the order I connected each of my button to the Outlet buttons collection. (damned !!) And, as the previous index var is not linked to this order but to the actual selected Index, my tab bar was just looking like a christmas tree... note : it's important to link each button to your buttons @IBOutlet Collection in the right order (as an array).