/Blog_SelectorSyntaxSugar

Swift's Selector use made more sugary

Primary LanguageSwiftApache License 2.0Apache-2.0

Swift: Selector syntax sugar

Objective-C developers be jelly

Medium post

Swift: Selector syntax sugar

tl;dr

Turn this:

let button = UIButton(type: .System)
button.addTarget(self, action: #selector(ViewController.buttonTapped(_:)), forControlEvents: .TouchUpInside)

Into this:

let button = UIButton(type: .System)
button.addTarget(self, action: .buttonTapped, forControlEvents: .TouchUpInside)