I have been trying to look for this solution for a very long time, but I can not find any documentation or tutorials on it. I want to set a tabbar item to the user's profile picture. Each user can only log into the app through Facebook. The app then takes the user's profile picture from facebook and stores it in firebase storage. I want to retrieve that image and set it to a tabbar item, but unfortunately, it is not working. Here is the code I have so far:
override func awakeFromNib() {
super.awakeFromNib()
self.tabBarItem.title = "MY ACCOUNT"
if self.loggedInUserUid != nil {
let imageRef = FIRStorage.storage().reference().child((loggedInUserUid)!+"/profile_pic.jpg")
imageRef.data(withMaxSize: 75 * 144 * 96, completion: { (data, error) -> Void in
if error != nil {
print(error!)
return
}
DispatchQueue.main.async(execute: { () -> Void in
let image = UIImage(data: data!)
self.tabBarItem.image = image
})
}).resume()
}}
i get the error: Could not load the "" image referenced from a nib in the bundle with identifier