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 to swift 4 #50

Merged
merged 8 commits into from
Nov 20, 2017
Merged

Update to swift 4 #50

merged 8 commits into from
Nov 20, 2017

Conversation

bsudekum
Copy link

Note, very few public functions are bridging to obj-c. This was probably the case before this pr.

/cc @1ec5 @frederoni

@@ -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())
Copy link
Member

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())
Copy link
Member

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)?

@bsudekum
Copy link
Author

@1ec5 this is ready for review.

Copy link
Member

@1ec5 1ec5 left a 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())
Copy link
Member

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`]().
Copy link
Member

Choose a reason for hiding this comment

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

Broken link?

Copy link
Author

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.

@bsudekum bsudekum mentioned this pull request Nov 20, 2017
1 task
@bsudekum bsudekum merged commit e9246ea into master Nov 20, 2017
@bsudekum bsudekum deleted the swift4 branch November 20, 2017 21:38
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

Successfully merging this pull request may close these issues.

2 participants