简体   繁体   English

适用于iOS的AWS开发工具包:从Swift 2到Swift 3的转换问题

[英]AWS SDK for iOS: problems with conversion from Swift 2 to Swift 3

I have downloaded the AWS SDK for iOS examples and opened them in XCode 8. Unfortunately there were lots of compiler errors due to the conversion from Swift 3. I fixed most of these but some functions still need fixing. 我已经下载了适用于iOS的AWS开发工具包示例,并在XCode 8中打开了它们。不幸的是,由于Swift 3的转换,出现了很多编译器错误。我修复了其中的大多数功能,但某些功能仍需要修复。

I am surprised that there is no official example from Amazon using Swift 3. 我很惊讶亚马逊没有使用Swift 3的官方示例。

  • What has been your approach? 您的处理方式是什么?
  • Did you go on fixing all these errors or has any of you found an example for Swift 3? 您是继续解决所有这些错误,还是找到了Swift 3的示例?

I am particularly interested in this sub-part of the repository: https://github.com/awslabs/aws-sdk-ios-samples/tree/master/S3TransferUtility-Sample/Swift/ 我对存储库的此子部分特别感兴趣: https : //github.com/awslabs/aws-sdk-ios-samples/tree/master/S3TransferUtility-Sample/Swift/

EDIT: 编辑:

I am testing the Objective-C version of the project as a proof of concept. 我正在测试该项目的Objective-C版本以作为概念证明。 Unfortunately when I run it I get the following error: 不幸的是,当我运行它时,出现以下错误:

Connection = "keep-alive";
"Content-Length" = 451;
"Content-Type" = "application/x-amz-json-1.1";
Date = "Fri, 13 Jan 2017 15:59:58 GMT";
"x-amzn-ErrorMessage" = "2 validation errors detected: Value 'arn:aws:cognito-idp:eu-west-1:99999999999:userpool/eu-west-1_XXXXXXXXX' at 'identityPoolId' failed to satisfy constraint: Member must have length less than or equal to 55; Value 'arn:aws:cognito-idp:eu-west-1:99999999999:userpool/eu-west-1_XXXXXXXXX' at 'identityPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern

It puzzles me as I thought I had configured the identity pool correctly in the Info.plist file. 我以为我已经在Info.plist文件中正确配置了身份池,这使我感到困惑。

See below (the details of the pool are hidden partially, but they are the same as the ones that the Database administrator gave me). 参见下文(池的详细信息被部分隐藏,但与数据库管理员给我的相同)。

在此处输入图片说明

Any ideas of why this is happening? 为什么会这样?

Literal message says that identityPoolId' failed to satisfy constraint but I am not convinced about this. 文字消息说, identityPoolId'无法满足约束条件,但是我对此并不确信。 It could be that there is some configuration missing on the server side. 服务器端可能缺少某些配置。

Unfortunately the documentation is not complete and I am a bit lost at the moment (feels like a waste of time). 不幸的是,文档还不完整,目前我有点迷茫(感觉像是在浪费时间)。

您的身份池ID的格式应为eu-west-1:xxxxxxxxxx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM