我正在尝试使用 AWS Cognito 作为后端将用户身份验证功能添加到我的应用程序中。
到目前为止,每当我的应用程序尝试构建时,我都会收到此错误,并且当它在我的两个类中指向这些错误时。
AWSMobileClient 类:
func didFinishLaunching(application: UIApplication, withOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
print("didFinishLaunching:")
let didFinishLaunching = AWSIdentityManager.defaultIdentityManager().interceptApplication(application, didFinishLaunchingWithOptions: launchOptions)
if (!isInitialized) {
AWSIdentityManager.defaultIdentityManager().resumeSession(completionHandler: {(_ result: AnyObject, _ error: Error) -> Void in
print("result = \(result), error = \(error)")
} as! (Any?, Error?) -> Void) --> ERROR ON THIS LINE <--
isInitialized = true
}
return didFinishLaunching
}
AppDelegate 类:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return AWSMobileClient.sharedInstance.didFinishLaunching(application: application, withOptions: launchOptions as [NSObject : AnyObject]?) --> ERROR ON THIS LINE <--