Created
February 16, 2015 19:19
-
-
Save rraallvv/ce2e20ef48cb61b9ee5a to your computer and use it in GitHub Desktop.
Get viewController of a given view
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
#define UIViewParentController(__view) ({ \ | |
UIResponder *__responder = __view; \ | |
while ([__responder isKindOfClass:[UIView class]]) \ | |
__responder = [__responder nextResponder]; \ | |
(UIViewController *)__responder; \ | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment