Last active
August 19, 2016 17:19
-
-
Save Pearapps/ca25c19faaf277415b87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CollectionType where Index: BidirectionalIndexType { | |
func lastIndexOf(isElement: Generator.Element -> Bool) -> Index? { | |
return indices.reverse().filter { return isElement(self[$0]) }.first | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment