Created
December 17, 2018 08:40
-
-
Save sarunw/05416283538ef1972fed3d0d8b2e578d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
if segue.identifier == "showDetail" { | |
if let indexPath = tableView.indexPathForSelectedRow { | |
let object = fetchedResultsController.object(at: indexPath) | |
let controller = (segue.destination as! UINavigationController).topViewController as! DetailViewController | |
controller.detailItem = object | |
controller.navigationItem.leftBarButtonItem = splitViewController?.displayModeButtonItem | |
controller.navigationItem.leftItemsSupplementBackButton = true | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment