Skip to content

Instantly share code, notes, and snippets.

@iosdevzone
Created May 22, 2015 22:06
Show Gist options
  • Save iosdevzone/fb06b61dab4ec2dc1801 to your computer and use it in GitHub Desktop.
Save iosdevzone/fb06b61dab4ec2dc1801 to your computer and use it in GitHub Desktop.
Filtering array based on indexSet
func objectsAtIndexes<T:AnyObject>(array: [T], indexes:NSIndexSet) -> [T]
{
return ((array as NSArray).objectsAtIndexes(indexes) as [T])
}
@isoiphone
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment