I looked at the API for iOS programming and read about view controllers and UIViews. It seems that subclasses of UIViewController are really useful for Modal navigation and custom animation, but I see no other uses than this.
What is the advantage of using subclasses of UIViewController rather than the usual subclass of NSObject?
Why
@interface MyViewController : UIViewController { } -(void)handleEvent; @end
Instead of just
@interface MyViewController : NSObject { UIView* view; } @property(retain) UIView* view; -(void)handleEvent; @end
Aren't you just adding the view to the window, and not the viewController itself? For most purposes, aren't all the functions you need to encapsulate in a UIView object? You just add it like this:
[window addSubview:myViewControllerInstance.view]
Is UIViewController used for use other than built-in functions such as Modal Navigation?
Thanks.
(Sorry if this is a stupid question, I have been studying this for 2 days already)
ios objective-c uiviewcontroller uiview
user434565
source share