Skip to content

Instantly share code, notes, and snippets.

@Daemon-Devarshi
Created June 20, 2015 20:02
Show Gist options
  • Save Daemon-Devarshi/7ea73784219b0dc46f01 to your computer and use it in GitHub Desktop.
Save Daemon-Devarshi/7ea73784219b0dc46f01 to your computer and use it in GitHub Desktop.
Extended NSArrayController in swift
extension NSArrayController {
/// Method which can be binded in storyboard to remove all objects from array controller
@IBAction func removeAllObjects(sender: AnyObject) {
let range = NSMakeRange(0, self.arrangedObjects.count)
self.removeObjectsAtArrangedObjectIndexes(NSIndexSet(indexesInRange: range))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment