This file contains hidden or 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
| public struct Stack<Element> | |
| { | |
| fileprivate var stackItems: [Element] = [Element]() | |
| public init() {} | |
| public mutating func pop() -> Element? { | |
| guard !stackItems.isEmpty else { | |
| return nil |
This file contains hidden or 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) | |
| } | |
| } |
This file contains hidden or 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
| import UIKit | |
| @objc protocol SelectorContext { | |
| var selector: Selector { get } | |
| func selectorCallback(_ sender: Any) | |
| } | |
| extension UIViewController: SelectorContext { |
NewerOlder