ios - XCode Errors on bridged AWS SDK -
i'm pretty new ios , 100% new aws. i'm building app needs upload files. downloaded amazon sdk through cocoapods , used bridging header work in swift.
here's header:
#ifndef objc_bridging_header_h #define objc_bridging_header_h #import "awscore.h" #import "awss3.h" #import "awsdynamodb.h" #import "awssqs.h" #import "awssns.h" #import "awscognito.h" #endif /* objc_bridging_header_h */
i pointed file in build settings tell compiler was.
then tried configure sdk in appdelegate.swift code:
var window: uiwindow? let cognitoaccountid = "i'm not going post this" let cognitoidentitypoolid = "i'm not going post this" let cognitounauthrolearn = "i'm not going post this" let cognitoauthrolearn = "i'm not going post this" func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { let credentialsprovider = awscognitocredentialsprovider.credentialswithregiontype( awsregiontype.useast1, accountid: cognitoaccountid, identitypoolid: cognitoidentitypoolid, unauthrolearn: cognitounauthrolearn, authrolearn: cognitoauthrolearn) let defaultserviceconfiguration = awsserviceconfiguration( region: awsregiontype.useast1, credentialsprovider: credentialsprovider) awsservicemanager.defaultservicemanager().setdefaultserviceconfiguration(defaultserviceconfiguration) return true }
(and yes, put in of id strings etc. didn't want post them)
everything works except last line: awsservicemanager.defaultservicemanager().setdefaultserviceconfiguration(defaultserviceconfiguration)
it errors saying: "value of type 'awsservicemanager' has no member 'setdefaultserviceconfiguration'"
why working except line? what's wrong?
awsservicemanager
has no setter defaultserviceconfiguration
.
instead have use
awsservicemanager.defaultservicemanager().defaultserviceconfiguration = defaultserviceconfiguration
this'll work.
Comments
Post a Comment