I have a pointer to a UIView. How do I access its UIViewController? [self superview] is another UIView, but not the
For debug purposes only, you can call _viewDelegate on views to get their view controllers. This is private API, so not safe for App Store, but for debugging it is useful.
Other useful methods:
_viewControllerForAncestor - get the first controller that manages
a view in the superview chain. (thanks n00neimp0rtant)_rootAncestorViewController - get the ancestor controller whose
view hierarchy is set in the window currently.