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? #6

Open
peduarte opened this issue Sep 29, 2015 · 5 comments
Open

Swift? #6

peduarte opened this issue Sep 29, 2015 · 5 comments

Comments

@peduarte
Copy link

Please don't hate me... but, what are the chances of getting this in Swift?

This library looks great and seems to be exactly what I am after, only problem is that I don't know Objective-C and just getting into Swift.
Can I use this library "with Swift", if that makes sense?

Thanks

@marciniwanicki
Copy link
Owner

@peduarte good point. I will put some comments later this week how to use it in Swift projects.

@peduarte
Copy link
Author

@marciniwanicki thanks a lot man!

@adrianrodriguez88
Copy link

adrianrodriguez88 commented May 22, 2016

any update in swift implementation?

@ghost
Copy link

ghost commented Apr 30, 2017

@marciniwanicki is there any chance this is going to happen soon?

@marciniwanicki
Copy link
Owner

Sorry guys, I could not find time to maintain the project. As far as I know you can use the library as it is in Swift 3 projects (with use_frameworks! in your Podfile). Yeah, the public API won't be very nice and "swifty" but at least you can get some data.

You need to first import framework
import OCGoogleDirectionsAPI

and then

    let client = OCDirectionsAPIClient(key: "<api key>")
    let request = OCDirectionsRequest(originString: "Reading", andDestinationString: "London")
    
    _ = client?.directions(request, response: { (response, error) in
   // your implementation
    })

I will think about rewriting it completely in Swift but cannot promise anything now. I've checked quickly and there are already some pure swift implementations (https://cocoapods.org/?q=lang%3Aswift%20GOOGLE%20DIRECTIONS%20), maybe it you can try one of them.

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

No branches or pull requests

3 participants