AWS Auth UI 登录 - 键盘错误

AWS Auth UI Login - Keyboard Bug

在 AWS Auth UI 中,当我单击用户名文本字段时,它会将字段移出视图。这在 Plus 和常规尺寸的设备上都会发生。我正在使用 XCode 9.3 和 Swift 4.1.

这是我下面调用 AWSAuthUIViewController 的代码。

    if !AWSSignInManager.sharedInstance().isLoggedIn {
        let config = AWSAuthUIConfiguration()
        config.enableUserPoolsUI = true
        config.backgroundColor = .black
        config.isBackgroundColorFullScreen = true
        config.logoImage = #imageLiteral(resourceName: "LogoBlack")
        config.canCancel = true

        AWSAuthUIViewController.presentViewController(with: self.navigationController!,
                                                      configuration: config,
                                                      completionHandler: { (provider: AWSSignInProvider, error: Error?) in
                                                        if error != nil {
                                                            print("Error occurred: \(error)")
                                                        } else {
                                                            self.onSignIn()
                                                        }
        })

您可以在 https://imgur.com/a/DFxHG - iPhone 8 Plus 模拟器中查看错误的图像。

看起来这个问题出现在最新版本的 AWS iOS Swift pods 中。如果您查看 AWSSignInViewController.m 从 2.6.13 到 2.6.14 here 的差异,您会发现添加了用于处理 hide/show 事件的代码软键盘。

TL;DR 只需为所有 AWS pods 指定版本 2.6.13,直到 Amazon 在以后的版本中解决他们的 UI 问题,如下所示:

pod 'AWSAuthCore', '2.6.13'
pod 'AWSUserPoolsSignIn', '2.6.13'
pod 'AWSAuthUI', '2.6.13'
pod 'AWSPinpoint', '2.6.13'
pod 'AWSCognito', '2.6.13'
pod 'AWSAPIGateway', '2.6.13'
pod 'AWSCognitoIdentityProvider', '2.6.13'
pod 'AWSS3', '2.6.13'
...

编辑: 这已被验证在 2.6.17

中得到解决