Created
February 6, 2019 18:44
-
-
Save mntone/322a2c608a409a7dda6b58780203b348 to your computer and use it in GitHub Desktop.
掃き溜めとして置いておきます
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 | |
| extension UIResponder { | |
| public func find<T: UIResponder>() -> T? { | |
| if let nextResponder = self.next { | |
| if let nextResponder = nextResponder as? T { | |
| return nextResponder | |
| } else { | |
| return nextResponder.find() | |
| } | |
| } | |
| return nil | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment