Last active
March 30, 2018 14:10
-
-
Save thepost/96c6cac5f6d49c0e16151ece70280247 to your computer and use it in GitHub Desktop.
A small extension to demonstrate how to use selectorCallback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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