-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Comparison #1: tableView:didSelectRowAtIndexPath: #1
Comments
Building off of the @cdzombak optionals discussion, we should note that the |
A couple of thoughts, @KevinVitale, to make sure we understand some Swift syntax pecularities: I’m all for using a Swift closure where we might have used dat C extension. We can ditch the wrapping parens, and we can even simplify the closure: self.navigationController.pushViewController(({
var viewController = UIViewController()
viewController.view.backgroundColor = UIColor.whiteColor()
return viewController
})(),
animated: true) Since there are no arguments for the closure, and the compiler can infer the return type, we can just drop the signature stuff. |
I believe in this case it will be much more clear to... em... let viewController:
|
No doubt that |
Thought it would be valuable to give a comparison of common patterns in Cocoa (Touch).
Objective-C
Swift
The text was updated successfully, but these errors were encountered: