I want to put online image on tab bar item.
Is this possible in iOS?
You can use WebImage and load it by using SDWebImage.
https://github.com/rs/SDWebImage
So once it load and you get the object of UIImage
inside its method you can check UIImage object should not be nil If not nil then set that UIImage
to your tabbar Item Image.
imageView.sd_setImageWithURL(NSURL(string: urlString), completed: {
(image, error, cacheType, url) in
// Change tabbar item image here....
tabHome.image=image?.withRenderingMode(.alwaysOriginal) // deselect image
tabHome.selectedImage = image?.withRenderingMode(.alwaysOriginal) // select image
})
Reference: how to set image in a tab bar item in swift?
This is possible in iOS via UITabBarItem
You need to select UITabBarItem constructor for your business and set the image
UITabBarItem(title: String?, image: UIImage?, selectedImage: UIImage?)
UITabBarItem(title: String?, image: UIImage?, tag: Int)