【发布时间】:2015-10-28 15:30:42
【问题描述】:
我正在尝试为我的应用个人资料页面提取用户名和个人资料图片。我正在使用 Parse 和 Facebook SDK。
我有一个 UILabel 和一个 UIView 作为插座连接。
当我尝试设置 profileImageView 时,它给了我错误 “'UIImageView' 类型的值没有成员 'setImageWithURL'” 这是 Swift 的升级吗?
这是我的代码...
func setProfilePicture() {
FBSDKGraphRequest(graphPath: "me", parameters: nil).startWithCompletionHandler({ (connection, result, error) -> Void in
if let dict = result as? Dictionary<String, AnyObject> {
let name: String = dict["name"] as! String
let facebookID: String = dict["id"] as! String
let pictureUrl = "https://graph.facebook.com/\(facebookID)/picture?type=large&return_ssl_resources=1"
self.profileImageView.setImageWithURL(NSURL(string: pictureUrl)!)
self.nameLabel.text = name
PFUser.currentUser()!.setValue(name, forKey: "name")
PFUser.currentUser()!.saveInBackground()
}
})
}
【问题讨论】:
标签: facebook swift parse-platform profile