Skip to content

Instantly share code, notes, and snippets.

@thepost
Last active March 30, 2018 14:10
Show Gist options
  • Save thepost/96c6cac5f6d49c0e16151ece70280247 to your computer and use it in GitHub Desktop.
Save thepost/96c6cac5f6d49c0e16151ece70280247 to your computer and use it in GitHub Desktop.
A small extension to demonstrate how to use selectorCallback
class SelectorDemoViewController: UIViewController {
override func viewDidLoad() {
NotificationCenter.default.addObserver(self,
selector: selector,
name: kUnwindNotification,
object: nil)
}
}
extension SelectorDemoViewController {
override func selectorCallback(_ sender: Any) {
if let button = (sender as? UIButton) {
unwindWebView(button)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment