I have a multiple selection on a UITableview made in Swift and I declare an Array that holds the NSIndexPaths of the selected UITableView Cells.
self.selectedRows = self.preferencesTableView.indexPathsForSelectedRows()
How do I convert this array to readable terms. e.g self.selectedRows is NSlogged like :
Selected Items Strings [ {length = 2, path = 0 - 1}, {length = 2, path = 0 - 0}, {length = 2, path = 0 - 3}]
I wan to be able to convert this to : 1,2,3 .
In Objective C I enumerateObjectsWithOptions through the array and add the id of the array to a mutable array to get what I want.
[self.selectedRows enumerateObjectsWithOptions:NSEnumerationReverse
usingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSIndexPath *indexPath = obj;
[self.selectedCategorieItems addObject:[[[self.categoryArr
objectAtIndex:0] objectForKey:@"id"]objectAtIndex:indexPath.row]];
}];
How do I do this in Swift?