Last active
January 16, 2021 21:00
-
-
Save dmytro-anokhin/dd26eec86534270a1dfb79a3b7a730a2 to your computer and use it in GitHub Desktop.
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
extension UIResponder { | |
/// The responder chain from the target responder (self) | |
/// to the `UIApplication` and the app delegate | |
var responderChain: [UIResponder] { | |
var responderChain: [UIResponder] = [] | |
var currentResponder: UIResponder? = self | |
while currentResponder != nil { | |
responderChain.append(currentResponder!) | |
currentResponder = currentResponder?.next | |
} | |
return responderChain | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment