Last active
February 11, 2016 11:28
-
-
Save trevorah/0d3a7a6685e6fc468084 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
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