Skip to content

Instantly share code, notes, and snippets.

@trevorah
Last active February 11, 2016 11:28
Show Gist options
  • Save trevorah/0d3a7a6685e6fc468084 to your computer and use it in GitHub Desktop.
Save trevorah/0d3a7a6685e6fc468084 to your computer and use it in GitHub Desktop.
class MasterViewController: UITableViewController {
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if let indexPath = tableView.indexPathForSelectedRow {
let object = objects[indexPath.row] as! NSDate
let controller = (storyboard?.instantiateViewControllerWithIdentifier("DetailViewController"))! as! DetailViewController
controller.detailItem = object
controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem()
controller.navigationItem.leftItemsSupplementBackButton = true
navigationController!.popToRootViewControllerAnimated(false)
navigationController!.pushViewController(controller, animated: true)
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment