Is there a built-in way to get from a UIView to its UIViewController? I know you can get from UIViewController to its UIView
UIView
UIViewController
If you aren't going to upload this to the App Store, you can also use a private method of UIView.
@interface UIView(Private) - (UIViewController *)_viewControllerForAncestor; @end // Later in the code UIViewController *vc = [myView _viewControllerForAncestor];