Unable to set AWSAPIGatewayClient configuration in Swift 3?

I am trying to add the generated AWS API SDK to my iOS application written in Swift 3. The code generated by AWS contains many things that cannot be compiled in Swift 3, but I hope I can work with most of them. However, one of the mistakes made me confused.

The AWSAPIGatewayClient class (precompiled) from the AWS library is as follows:

open class AWSAPIGatewayClient : NSObject {   
    open var configuration: AWSServiceConfiguration! { get }
    open var apiKey: String!
}

And the created child class has this init function:

init(configuration: AWSServiceConfiguration) {
    super.init()

    self.configuration = configuration

    ...
}

The compiler naturally complains that the configuration property has only get-only:

AWSMyServiceClient.swift:127:25: Cannot assign to property: 'configuration' is a get-only property

Am I missing something obvious or how can this work? I could not find anyone else with the same problem, which makes me suspect that something is wrong with my specific code.

+4
1

API SDK Swift AWSApiGatewayBridge.h , ( Bridging_Header.h).

SDK AWSApiGatewayBridge.h, c c.

,

+3

Source: https://habr.com/ru/post/1656861/


All Articles