Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8: Selected image for custom tab bar item set in interface builder does not work

I have set in Storyboard tab bar item to be Custom, Image to my outline image and Selected image to my filled image but the selected image does not show up when I run the app.

It works if I create a tab bar item programmatically using UITabBarItem(title: String?, image: UIImage?, selectedImage: UIImage?)

I use Xcode 6.1.1.

What can be wrong?

like image 256
Bartosz Bialecki Avatar asked Dec 14 '22 17:12

Bartosz Bialecki


1 Answers

I think, it is a bug of Xcode, if you add a user defined runtime attribute with type Image and keyPath "selectedImage", you'll can set your image.
Here example of the Tabbed Application template with a custom selected image on the second tab (I use a image from the first tab): enter image description here

like image 80
Andrew Romanov Avatar answered May 07 '23 16:05

Andrew Romanov