Skip to content

Update to swift 4#50

Merged
bsudekum merged 8 commits intomasterfrom
swift4
Nov 20, 2017
Merged

Update to swift 4#50
bsudekum merged 8 commits intomasterfrom
swift4

Conversation

@bsudekum
Copy link
Copy Markdown

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

/cc @1ec5 @frederoni

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: drop self..

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
Copy Markdown
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
Copy Markdown
Author

@1ec5 this is ready for review.

Copy link
Copy Markdown
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.

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
Copy Markdown
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()

Comment thread README.md Outdated
[![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
Copy Markdown
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
Copy Markdown
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.

Bobby Sudekum added 2 commits November 20, 2017 13:27
@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