I’m trying to get objects from the backend and map them to classes defined in Swift from the SDK BackendlessSwift v6.0.4.1 so simliar to Android however I cannot find this functionality from customService.invoke
topic relationed
- App ID: BAFA98AD-EB6A-DCBD-FF35-67E7A51C7300
- Sample client code:
@objcMembers
class Person : NSObject {
var age: Int?
var name: String?
}
let response = { (data: Any?) -> Void in
print("--------------")
print(data as! Person)
print("--------------")
}
let errorHandler = { (error: Fault) -> Void in
print(error)
}
Backendless.shared.customService.invoke(serviceName: "test", method: "get", parameters: nil , returnType: Person.self, executionType: .sync, responseHandler: response, errorHandler: errorHandler)
- Exception:
Could not cast value of type 'Swift._SwiftDeferredNSDictionary<Swift.String, Any>'