-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Thought it would be valuable to give a comparison of common patterns in Cocoa (Touch).
Objective-C
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.navigationController pushViewController:({
UIViewController *viewController = UIViewController.new;
viewController.view.backgroundColor = UIColor.blueColor;
viewController;
})
animated:YES];
}
Swift
override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) {
self.navigationController.pushViewController(({
() -> UIViewController? in
var viewController = UIViewController()
viewController.view.backgroundColor = UIColor.whiteColor()
return viewController
})(),
animated: true)
}
Metadata
Metadata
Assignees
Labels
No labels