iOS-如何使用Swift快速编程
我正在创建一个使用Facebook SDK来验证用户身份的应用程序。我正在尝试将Facebook逻辑合并到一个单独的类中。这是代码(为简单起见而被剥离): import Foundation class FBManager { class func fbSessionStateChane(fbSession:FBSession!, fbSessionState:FBSessionState, error:NSError?){ //... handling all session states FBRequestConnection.startForMeWithCompletionHandler { (conn: FBRequestConnection!, result: AnyObject!, error: NSError!) -> Void in println("Logged in user: \n\(result)"); let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) let loggedInView: UserViewController = storyboard.instantiateViewControllerWithIdentifier("loggedInView") as UserViewController loggedInView.result = result; //todo: …