原始语法:
错误是
Value of optional type 'Any?' not unwrapped; did you mean to use '!' or '?'? on
result
variable
FBSDKGraphRequest(graphPath: "me", parameters: parameter).start { (connection, result, error) in
if error != nil {
print(error)
return
}
if let email = result["email"] as? String {
print(email)
}
}
最佳答案
如果 result
应该是一个字典,您必须选择向下转换并将 Any?
解包为预期的类型:
if let item = result as? [String:Any],
let email = item["email"] as? String {
print(email)
}
关于ios - FBSDKGraphRequest : result - Value of optional type 'Any?' not unwrapped; did you mean to use '!' or '?' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47413266/