I have this code in my ViewController.swift for invoking my REST API (via AWS API Gateway) and am attempting to print `result` to the console. Clearly, all I'm doing here is printing the address of the class object:
@IBAction func userInvokeApi(_ sender: UIButton) {
print("You clicked invoke api...")
let client = SVTLambdaGateClient.default()
client.calcGet(operand2: "3", _operator: "+", operand1: "5").continueWith{ (task: AWSTask?) -> AnyObject? in
if let error = task?.error {
print("Error occurred: \(error)")
return nil
}
if let result = task?.result {
// Do something with result
print("The result is... \(result)")
}
return nil
}
}
Here's what prints:
You clicked invoke api... The result is... <AmplifyRestApiTest.Empty: 0x600003309940> {
}
Now, in the Variables view of the debug console this is what I see:
> result = (RestApiTest.Empty) 0x600003309940
> AWSCore.AWSModel (AWSModel)
> baseAWSMTLModel@0 (AWSMTLModel)
> NSObject
isa = (Class) 0x600003309940
Or, when I issue `(lldb) p result` in the debug console:
(lldb) p result
(RestApiTest.Empty) $R0 = 0x0000600003309940 {
AWSCore.AWSModel = {
baseAWSMTLModel@0 = {
NSObject = {
isa = 0x0000600003309940
}
}
}
}
Can someone explain to me why I am not seeing the values?
As some background, I'm using the AWS API Gateway-generated iOS Swift SDK to access my REST API from my iOS Client. I followed all of the tutorial instruction for using the SDK in my project. I know that I'm invoking the REST API successfully because I can see (via Cloudwatch logs) that it's returning the result to the Client.