Blog_SelectorSyntaxSugar
Blog_SelectorSyntaxSugar copied to clipboard
Swift's Selector use made more sugary
Swift: Selector syntax sugar
Objective-C developers be jelly
Medium post
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)