Skip to content

Instantly share code, notes, and snippets.

@dmytro-anokhin
Last active January 16, 2021 21:00
Show Gist options
  • Save dmytro-anokhin/dd26eec86534270a1dfb79a3b7a730a2 to your computer and use it in GitHub Desktop.
Save dmytro-anokhin/dd26eec86534270a1dfb79a3b7a730a2 to your computer and use it in GitHub Desktop.
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