Open agfa555 opened 7 years ago
I am struggling with "Cannot convert value of type '(NSError!) -> Void' to expected argument type 'SLFailureBlock!'". This code sipped was working for Swift 2 and it seems there is a problem with Swift 3:
financial.saveWithSuccess(
{() -> Void in
NSLog("Financial saved")
}, failure: { (error: NSError!) -> Void in
// failure block
}
)
I am not an expert in Loopback iOS SDK though. It would be great if some one can prove this SDK working for Swift v3.
Hi @yellowred,
Try changing to:
financial .save(success: { () -> Void in
NSLog("Financial saved")
}, failure: { (error: Error?) -> Void in
// failure block
})
It's so sad this SDK is not updated for more than a year. I think we're dropping from Loopback soon. Hope it works.
@bajtos ^
Hello, I am afraid Swift 3 support in the iOS SDK is not a priority for us right now. Would you mind contributing the necessary changes yourself?
I have made so many changes already that I don't think it might suit other people. Support for Swift 3 is nothing more than a few improvements to the Objective-C code. Here's a very good article on what to do and not to do: https://realm.io/news/altconf-conrad-kramer-writing-iOS-sdk/
SDK is throwing millions of errors in Swift 3.0 Anyone has it working?