Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 3.0 #120

Open
agfa555 opened this issue Sep 14, 2016 · 5 comments
Open

Swift 3.0 #120

agfa555 opened this issue Sep 14, 2016 · 5 comments
Labels

Comments

@agfa555
Copy link

agfa555 commented Sep 14, 2016

SDK is throwing millions of errors in Swift 3.0
Anyone has it working?

@yellowred
Copy link

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.

@agfa555
Copy link
Author

agfa555 commented Sep 19, 2016

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.

@superkhau
Copy link
Contributor

@bajtos ^

@bajtos
Copy link
Contributor

bajtos commented Sep 20, 2016

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?

@agfa555
Copy link
Author

agfa555 commented Oct 6, 2016

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants