Credit for extending Selector goes entirely to Andyy Hope (@AndyyHope) who posted this article on Medium: He looks at the problem of Swift selector syntax being somewhat unwieldy, and turns it into [code language=”plain”]fileprivate extension Selector { static let buttonTapped = #selector(ViewController.buttonTapped(_:)) }[/code] Thanks to fileprivate, you don’t get namespacing conflicts. Awesome. So I […]
Jan 8 2017
Awesome Extensions: Selector
Credit for extending Selector goes entirely to Andyy Hope (@AndyyHope) who posted this article on Medium: He looks at the problem of Swift selector syntax being somewhat unwieldy, and turns it into [code language=”plain”]fileprivate extension Selector { static let buttonTapped = #selector(ViewController.buttonTapped(_:)) }[/code] Thanks to fileprivate, you don’t get namespacing conflicts. Awesome. So I […]
By Extelligent Cocoa • Extensions, Wiki • • Tags: NotificationCentre, NSNotification.Name, Selector