我已經搜索了很長時間,現在沒有任何東西可以用於我。我能夠將用戶的用戶名,電子郵件,密碼和樣本位置上傳到Parse上的「用戶」類。但是我需要上傳一張圖片給用戶的佔位符配置文件圖像。我在Xcode的資產中有圖像(ProfileImagePlaceHolder.png)使用Swift 2.0添加圖像進行分析使用Swift 2.0
如何將此圖像上傳到用戶的個人資料圖片進行分析?
@IBAction func registerTapped(sender: UIButton)
{
print("Register Page - Register Tapped")
if txtEmailAddress.text == "" || txtPassword.text == "" || txtPasswordConfirmation.text == ""
{
print("Registration fields are not complete.")
REGISTER_INCOMPLETE_FIELD.show()
}
else if txtPassword.text != txtPasswordConfirmation.text
{
print("Password Confirmation does not match with Password.")
PASSWORD_CONFIRMATION_DOESNT_MATCH.show()
}
else
{
let user = PFUser()
user.username = txtEmailAddress.text
user.password = txtPassword.text
user.email = txtEmailAddress.text
user["location"] = PFGeoPoint(latitude: 41, longitude: 29)
user.signUpInBackgroundWithBlock {
(succeeded: Bool, error: NSError?) -> Void in
if error != nil {
print("There is a problem.")
SOMETHING_IS_WRONG.show()
} else {
// Hooray! Let them use the app now.
print("Successfully registered.")
SUCCESS_REGISTER.show()
self.performSegueWithIdentifier(SEGUE_REGISTERED, sender: self)
//
}
}
}
}
這個問題你檢查我下面的答案嗎? – Vijay