void函数swift中的意外非void返回值

时间:2016-11-25 11:53:22

标签: swift3

编译错误是void function swift中的意外非void返回值。

static func getPhoto(byURL url: String) -> UIImage {
        let photoPrefix = "gs://chatwithroyal-6c9ee.appspot.com/"
        let photoType = ".png"
        let photoURL = photoPrefix + url + photoType
        let image = UIImage()
        FIRStorage.storage().reference(forURL: photoURL).data(withMaxSize: INT64_MAX, completion: { (data, error) in
            if let error = error {
                print("Error downloading: '\(error)")
                return
            }
            let image = UIImage.init(data: data!)
            return image
        })
    }

任何想法都会非常感激!谢谢!

0 个答案:

没有答案