I want to convert NStableView.selectedRowIndexes
to an int array. Is there a fast way to do that? Or should I iterate the IndexSet and push each item to an array?
There are two simple ways you can do it.
1) Use map
let indexes = tableView.selectedRowIndexes.map({$0})
2) Pass the NSIndexSet
into the Array
initialiser
let indexes = Array(tableView.selectedRowIndexes)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With