-
Notifications
You must be signed in to change notification settings - Fork 13
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 to swift 4 #50
Conversation
@@ -15,7 +15,7 @@ protocol Tokenized { | |||
|
|||
extension String: Tokenized { | |||
public var sentenceCased: String { | |||
return String(characters.prefix(1)).uppercased() + String(characters.dropFirst()) | |||
return String(self.prefix(1)).uppercased() + String(dropFirst()) |
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: drop self.
.
@@ -15,7 +15,7 @@ protocol Tokenized { | |||
|
|||
extension String: Tokenized { | |||
public var sentenceCased: String { | |||
return String(characters.prefix(1)).uppercased() + String(characters.dropFirst()) | |||
return String(self.prefix(1)).uppercased() + String(dropFirst()) |
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.
While we wait for CocoaPods/CocoaPods#7134 to be resolved, can we keep both the old and new syntaxes around, guarded by #if swift(>=4)
?
@1ec5 this is ready for review. |
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.
One minor change, but otherwise good to go.
@@ -15,7 +15,7 @@ protocol Tokenized { | |||
|
|||
extension String: Tokenized { | |||
public var sentenceCased: String { | |||
return String(characters.prefix(1)).uppercased() + String(characters.dropFirst()) | |||
return String(prefix(1)).uppercased() + String(dropFirst()) |
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.
Substring also has an uppercased()
method, so this expression simplifies to:
prefix(1).uppercased() + dropFirst()
README.md
Outdated
@@ -4,7 +4,7 @@ | |||
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) | |||
[![CocoaPods](https://img.shields.io/cocoapods/v/OSRMTextInstructions.svg)](http://cocoadocs.org/docsets/OSRMTextInstructions/) | |||
|
|||
OSRM Text Instructions is a library for iOS, macOS, tvOS, and watchOS applications written in Swift 3 or Objective-C that transforms [OSRM](http://www.project-osrm.org/) route responses into localized text instructions. | |||
OSRM Text Instructions is a library for iOS, macOS, tvOS, and watchOS applications written in Swift 4 or Objective-C that transforms [OSRM](http://www.project-osrm.org/) route responses into localized text instructions. The last version for Swift 3.2 is `v0.5.0` and the code is also available on the branch [`swift3.2`](). |
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.
Broken link?
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.
Oh sorry forgot to add.
Note, very few public functions are bridging to obj-c. This was probably the case before this pr.
/cc @1ec5 @frederoni