FS.O5 FS.O5 - 3 months ago 42
iOS Question

Add gif animation under UITabBar item

I have a

UITabBarController
with 5 tabs.

I have a
GIF
file I want to place under each tab.

I'm using a 3rd party API (
UIImage
extension) called
SwiftGif
for using the gif so the question can be asked like that too:

"How can I place a
UIImage
under a
UITabBar
"

But I wanted to be more specific to help you understand better.

Answer

Try this to change the background of your tabBar self.tabBarController?.tabBar.backgroundImage = UIImageView(image: UIImage.gifWithName("yourGifName")) Keep in my mind that this syntax is from Swift 3 - if you are using Swift 2, you might have to change it a bit

Comments