-
Notifications
You must be signed in to change notification settings - Fork 92
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
Migrate to Swift 3 #64
Conversation
@1ec5, I have forked Polyline (no access to source), and have a swift 3 branch up which seems to work as expected with MapboxDirections |
@@ -33,21 +33,21 @@ public enum RouteShapeFormat: UInt, CustomStringConvertible { | |||
|
|||
This standard format is human-readable and can be parsed straightforwardly, but it is far more verbose than `Polyline`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lowercase polyline
.
Note that once raphaelmor/Polyline upgrades to Swift 3, you’ll need to update the podspec to require a newer version of that library. |
Swift 3 has changed to using lower case enums - see here -> https://www.hackingwithswift.com/swift3. Also, I asked for write access to Polyline so received no response. So I forked Polyline and pointed the podspec at the migrated fork. Once aphaelmor/Polyline is migrated, I can point at the original repo |
The podspec only covers the example application in this repository. The podfile still points to the official repository, and to my knowledge, there’s no way to automatically point it elsewhere. Every developer integrating this library will need to add your Polyline fork as a dependency ahead of any pod that uses Polyline. We’ll need a blurb in the readme to that effect. (For example, this library used to depend on my fork of RequestKit.) |
@1ec5 Apologies, you are correct. I did the same with my app. I added my Polyline fork as a dependency ahead of the original Polyline. I'll add the blurb to the readme |
@1ec5 I updated the readme to include the forked Polyline. However, I am unsure about how to handle Carthage. Any ideas? |
I think you’d add your branch in place of the existing Polyline entry:
|
@1ec5 Updated with the latest Beta 6 Swift language changes |
MapboxDirections/MBDirections.swift
Outdated
let request = NSMutableURLRequest(url: url) | ||
request.setValue(userAgent, forHTTPHeaderField: "User-Agent") | ||
return URLSession.shared.dataTask(with: request as URLRequest) { (data, response, error) in | ||
var json: JSONDictionary = [:] | ||
if let data = data { | ||
do { | ||
do { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: an extra space snuck in.
Update readme, it was referencing V0.6 of MapboxDirections
@1ec5 Ran Xcode GM Swift migrator |
Carthage Integration
I have no idea why one of the tvOS builds now fails:
|
Ugh, that’s the same error that’s been failing the watchOS build bot. |
221e451 fixes the tvOS and watchOS builds by replacing the superpeteblaze/Polyline dependency with raphaelmor/Polyline@f86f34d, which includes raphaelmor/Polyline#38. (Polyline’s master branch is currently broken: raphaelmor/Polyline#40.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest commit addresses the remaining suggested changes. v0.7.0 just went out the door as the last Swift 2.3 release, so we’re ready to land this PR.
Thanks for all your help, @superpeteblaze @Eldorado234!
Corrected some syntax errors in the examples. Point Podfile and Cartfile to master for now, until the first Swift 3 release. Updated links to the macOS SDK.
This PR’s swift3 branch was so long-lived that, out of expediency, we suggested that developers pin their Podfile or Cartfile directly to the branch (as opposed to a commit on the branch). Now that the swift3 branch has been merged to master, 5384a42 logs a warning to the console urging the developer to move to the master branch. The swift3 branch is no longer being maintained and will be deleted soon. If you pinned to a specific commit on this branch, that commit will continue to exist because it was merged into master. Otherwise, we urge you to heed the warning and move to master, and thence to the upcoming release once it’s published. |
What changed
Todos
Notify
@1ec5
Note