Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

swift - Upgrading Firebase broke my iOS project

I wish I had never updated my pod, the entire project was full of errors, one specific error is in the photo below, I can't fix it and I was ready to submit my app to the App Store now it seems like its all ruined. On top of this, it made me erase a bunch of optionals.

error message

 func uploadData(user: User) {
    let changeRequest = user.createProfileChangeRequest()
    changeRequest.displayName = self.nameUser.text!
    changeRequest.commitChanges(completion: nil)

    let imageRef = self.userStorage.child("(user.uid).jpg")

    let data = UIImageJPEGRepresentation(self.imageView.image!, 0.5)

    let uploadTask = imageRef.put(data!, metadata: nil, completion: { (metadata, err) in
        if err != nil {
            print(err!.localizedDescription)
        }

        imageRef.downloadURL(completion: { (url, er) in
            if er != nil {
                print(er!.localizedDescription)
            }


            if let url = url {



                let userInfo: [String : Any] =  ["age" : self.ageUser.text!,
                                                 "location" : self.location.text!,
                                                 "name" : self.nameUser.text!,
                                                 "image" : url.absoluteString,
                                                 "bio" : self.bioViewTwo.text!,
                                                 "contact" : self.contactUser.text!
                ]

                self.ref.child("SJ").child(user.uid).setValue(userInfo)

            }

        })

    })

    uploadTask.resume()
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...