Skip to content

use firstIndex(where:)#513

Closed
masashi-sutou wants to merge 1 commit intoapollographql:masterfrom
masashi-sutou:convert_firstIndex_swift_4_2
Closed

use firstIndex(where:)#513
masashi-sutou wants to merge 1 commit intoapollographql:masterfrom
masashi-sutou:convert_firstIndex_swift_4_2

Conversation

@masashi-sutou
Copy link
Copy Markdown

@masashi-sutou masashi-sutou commented Apr 17, 2019

  • use firstIndex(where:) , because index(where:) will be deprecated in Swift 4.2 before being removed in Swift 5.

In addition, the index(of:) and index(where:) methods will be renamed to firstIndex(of:) and firstIndex(where:), respectively. This change is beneficial for two reasons. First, it groups the first... and last... methods into two symmetric analogous groups, and second, it leaves the index... methods as solely responsible for index manipulation.

The name changes to index(of:) and index(where:) are easily migratable, and will be deprecated in Swift 4.2 before being removed in Swift 5.

ref: https://github.com/apple/swift-evolution/blob/master/proposals/0204-add-last-methods.md#detailed-design

Xcode10.2 Swift Conversion After converting to swift5, Generating preview

@apollo-cla
Copy link
Copy Markdown

@masashi-sutou: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@masashi-sutou
Copy link
Copy Markdown
Author

#522 was merged, so I close this issue.

@masashi-sutou masashi-sutou deleted the convert_firstIndex_swift_4_2 branch May 7, 2019 04:26
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.

4 participants