我收到此错误,
"类型的价值'任何?'在编译时没有成员' valueForKey'",用于userName,fbID,email和fbLink。
func croppImage(originalImage:UIImage, toRect rect:CGRect) -> UIImage{
var imageRef:CGImageRef = CGImageCreateWithImageInRect(originalImage.CGImage, rect)
var croppedimage:UIImage = UIImage(CGImage:imageRef)
return croppedimage
}
答案 0 :(得分:3)
您必须将Any
投射到更有意义的内容,例如[String:Any]
guard let fbData = result as? [String:Any] else { return }
let fbid = fbData["id"]
let email = fbData["email"]