2

我正在尝试使用 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 <--
4

1 回答 1

1

看起来 AWS MobileHub 示例代码还不兼容 swift3——这就是我正在运行的;也许你也是?请参阅此处以获取 AWS 的答案,以及使用旧编译器设置的提示(我尚未整理...)

于 2016-12-13T21:40:57.353 回答