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

use firstIndex(where:) #513

Conversation

masashi-sutou
Copy link

@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

@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
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