I have a tableview that allows multiple selection. I have set both allowsMultipleSelection and allowsMultipleSelectionDuringEditing to true in viewDidLoad and this is working perfectly on both iOS and iPadOS. I have decided to try out the Catalyst today and the app looks good except that I cannot select multiple rows in this view. Any ideas? Here is the code below. Many thanks in advance.
//allow multiple selection
override func viewDidLoad()
{
super.viewDidLoad()
self.tableView.allowsMultipleSelection = true
self.tableView.allowsMultipleSelectionDuringEditing = true
.....
}
//limit selection to 7 rows
override func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
if let selectedItems = tableView.indexPathsForSelectedRows {
if selectedItems.count > 6 {
return nil
}
}
return indexPath
}
@IBAction func doneButtonTapped(_ sender: UIBarButtonItem) {
...
let selectedIndexPaths = tableView.indexPathsForSelectedRows
if !selectedIndexPaths!.isEmpty {
for index in selectedIndexPaths! {
let selectedProcedure = fetchedResultsController?.object(at: index) as! Item
...
Rest of code to perform the required task
}