I have a split view app the works but I have a bug in it than I haven't been able to fix. I embeded the detail view controller in a navigation controller. The cell and the add button are connected to the embedded navigation controller. If I click on a cell to edit a record and then modally add a new record rather than showing the new record when I unwind the segue it remains on the edited record. Is there something I overlooked in the IB or a function I should add?
You are right it doesn't answer the question.
If you want to use the ToDo List app from Apple's "App Developement With Swift" on an iPad split view these two lines of code are one solution to make it work correctly.
Add this to the "if let SelectedIndexPath" code when you are editing a record to force it to reselect the row:
tableView.selectRow(at: selectedIndexPath, animated: true, scrollPosition: .none)
Add this to the modal segue when you add a record so no row is selected:
if let index = self.tableView.indexPathForSelectedRow {
self.tableView.deselectRow(at: index, animated: true)
}