更新时间:2023-12-04 23:30:04
这应该大致将上述Objective-C转换为Swift:
This should roughly translate the above Objective-C to Swift:
if (Twitter.sharedInstance().session() != nil) {
if let shareEmailViewController = TWTRShareEmailViewController(completion: {
(email: String!, error: NSError!) in
if (email != nil) {
print("\(email)")
} else {
print("\(error)")
}
}) {
self.presentViewController(shareEmailViewController, animated: true, completion: nil)
}
} else {
print("User not logged in")
}