Argument labels '(forUrl:)' do not match any available overloads

Hi. I am trying to make a social media app and I get this problem when I try and download a URL for a post. I am currently following Google's Firebase Documentation. Here is my code.

import UIKit

import Firebase

import FirebaseStorage


class ShareSomethingCell: UITableViewCell {

@IBOutlet weak var userImgView: UIImageView!


override func awakeFromNib() {

super.awakeFromNib()

// Initialization code

}


override func setSelected(_ selected: Bool, animated: Bool) {

super.setSelected(selected, animated: animated)


// Configure the view for the selected state

}

func configCell(userImgUrl: String) {

let httpsReference = Storage.storage().reference(forUrl: userImgUrl) THIS IS WHERE THE ERROR IS

httpsReference.getData(maxSize: 1 * 1024 * 1024) { data, error in

if let error = error {

// Uh-oh, an error occurred!

} else {

// Data for "images/island.jpg" is returned

let image = UIImage(data: data!)

self.userImageView.image = image

}

}

}


}

Replies

If you read the doc:

h ttps://firebase.google.com/docs/storage/ios/create-reference


you see you have to use forURL and not forUrl.

Uppercase are important in Swift.


Replace

        let httpsReference = Storage.storage().reference(forUrl: userImgUrl)  THIS IS WHERE THE ERROR IS

by

        let httpsReference = Storage.storage().reference(forURL: userImgUrl)



Note: when you post code, use the formatter tool (<>).

Did you solve your problem ? If not, what's the issue ? If yes, don't forget to close the thread.