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

Update for Swift 3 #35

Closed
wants to merge 2 commits into from
Closed

Update for Swift 3 #35

wants to merge 2 commits into from

Conversation

boundsj
Copy link

@boundsj boundsj commented Jun 22, 2016

This ports the Swift 2.2 implementation to Swift 3. It is a work in progress and there are several known issues but it is functional and can be used, for now, to help test applications written with the Xcode 8 and Swift 3 betas that use MapboxStatic.

Todo:

  • Syntax update to Swift 3 in library, example apps, and playgrounds
  • Use Swift 3 version of OHHTTPStubs
  • Consider wrapping changes in #if swift(>=3.0) blocks to help maintain backwards compatibility with Swift 2.2+

Known issues:

  • Tests won't run because the HTTP mock library is not updated, yet
  • The most obvious port of allowedCharacterSet in Overlay.swift seems to cause an exception in the
    first Xcode 8 beta. This needs more investigation. For now, the workaround is to use an inverted
    CharacterSet for MBCustomMarker and CharacterSet.urlPathAllowed for GeoJSON and Path overlays.

This ports the Swift 2.2 implementation to Swift 3.
case Medium
/// Large.
case Large
/// small.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: keep the documentation in sentence case.

request.setValue(userAgent, forHTTPHeaderField: "User-Agent")
let task = NSURLSession.sharedSession().dataTaskWithRequest(request) { (data, response, error) in
let task = URLSession.shared().dataTask(with: request as URLRequest) { (data, response, error) in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make request a var URLRequest so this cast is unnecessary.

@1ec5
Copy link
Contributor

1ec5 commented Jun 24, 2016

The most obvious port of allowedCharacterSet in Overlay.swift seems to cause an exception in the first Xcode 8 beta.

https://openradar.appspot.com/26880260

@1ec5
Copy link
Contributor

1ec5 commented Sep 30, 2016

Superseded by #41.

@1ec5 1ec5 closed this Sep 30, 2016
@1ec5
Copy link
Contributor

1ec5 commented Feb 20, 2017

The saga continues in #50.

@1ec5 1ec5 deleted the swift-3 branch February 20, 2017 11:26
@1ec5 1ec5 mentioned this pull request Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants