Fast enumeration on an NSIndexSet

后端 未结 6 732
南旧
南旧 2020-12-14 14:13

Can you fast enumerate a NSIndexSet? if not, what\'s the best way to enumerate the items in the set?

6条回答
  •  太阳男子
    2020-12-14 14:50

    These answers are no longer true for IndexSet in Swift 5. You can perfectly get something like:

    let selectedRows:IndexSet = table.selectedRowIndexes
    

    and then enumerate the indices like this:

    for index in selectedRows {
       // your code here.
    }
    

提交回复
热议问题