container.fetchUserRecordID { (recordID, error) in
if let error = error {
print(error.localizedDescription)
}
else{
guard let recordID = recordID else { return }
container.discoverUserIdentity(withUserRecordID: recordID, completionHandler: { (userIdentity, error2) in
if let error2 = error2{
print(error2.localizedDescription)
}
else{
if let userIdentity = userIdentity{
identity = userIdentity
}
}
})
}
}
return identity
在此代码的上,在container.discoverUserIdentity上,该代码输入else语句,但是userIdentity为nil,即使错误也为nil。知道为什么吗?