Created
May 22, 2015 22:06
-
-
Save iosdevzone/fb06b61dab4ec2dc1801 to your computer and use it in GitHub Desktop.
Filtering array based on indexSet
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
func objectsAtIndexes<T:AnyObject>(array: [T], indexes:NSIndexSet) -> [T] | |
{ | |
return ((array as NSArray).objectsAtIndexes(indexes) as [T]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had to change to as! to get it to compile, but this works! definite improvement over what I had.
So strange I can't make it work as an extension.