-
-
Save edwardean/e390b1c545a9f6a22a3c4c195cb6905e to your computer and use it in GitHub Desktop.
Get the closes view controller to the current view.
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
| @implementation UIView (PSPDFKitAdditions) | |
| - (UIViewController *)pspdf_closestViewController { | |
| UIResponder *responder = self; | |
| while ((responder = [responder nextResponder])) { | |
| if ([responder isKindOfClass:UIViewController.class]) break; | |
| } | |
| return (UIViewController *)responder; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment