Reputation: 3
So my question is: How to make a reference to a UIViewController from an outside ObjectiveC class. I have a ViewController, and a UIScrollView on it, and a class that needs to override some methods, and eventually return said UIScrollView. So, i figured that the easiest way to do this is to type:
return destinationViewController.scrollView;
but i don't quite know how to make the destinationViewController reference. Help?
Upvotes: 0
Views: 160
Reputation: 2215
You should be able to pass it as a parameter to the outside class, otherwise you should rethink your class design. In worst case, you can store it in AppDelegate or some specialized singleton (or public static field (like static UIViewController *g_ViewController) in the worst worst case)...
Upvotes: 1