28#define _Class _ViewController
39 release(this->childViewControllers);
45#pragma mark - ViewController
53 assert(childViewController);
130 if (self->
view == NULL) {
147 if (parentViewController) {
160 assert(childViewController);
200 if (view != self->
view) {
208 self->
view = retain(view);
276#pragma mark - Class lifecycle
283 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
286 ((ViewControllerInterface *) clazz->interface)->handleNotification =
handleNotification;
287 ((ViewControllerInterface *) clazz->interface)->init =
init;
288 ((ViewControllerInterface *) clazz->interface)->loadView =
loadView;
289 ((ViewControllerInterface *) clazz->interface)->loadViewIfNeeded =
loadViewIfNeeded;
293 ((ViewControllerInterface *) clazz->interface)->respondToEvent =
respondToEvent;
294 ((ViewControllerInterface *) clazz->interface)->setView =
setView;
295 ((ViewControllerInterface *) clazz->interface)->viewDidAppear =
viewDidAppear;
296 ((ViewControllerInterface *) clazz->interface)->viewDidDisappear =
viewDidDisappear;
297 ((ViewControllerInterface *) clazz->interface)->viewWillAppear =
viewWillAppear;
298 ((ViewControllerInterface *) clazz->interface)->viewWillDisappear =
viewWillDisappear;
310 clazz = _initialize(&(
const ClassDef) {
311 .name =
"ViewController",
312 .superclass = _Object(),
315 .interfaceSize =
sizeof(ViewControllerInterface),
static void handleNotification_recurse(const Array *array, ident obj, ident data)
ArrayEnumerator for handleNotification recursion.
static void viewWillDisappear_recurse(const Array *array, ident obj, ident data)
ArrayEnumerator for viewWillDisappear recursion.
static void viewDidDisappear_recurse(const Array *array, ident obj, ident data)
ArrayEnumerator for viewDidDisappear recursion.
static void dealloc(Object *self)
static void viewWillAppear_recurse(const Array *array, ident obj, ident data)
ArrayEnumerator for viewWillAppear recursion.
static void initialize(Class *clazz)
static void viewDidAppear_recurse(const Array *array, ident obj, ident data)
ArrayEnumerator for viewDidAppear recursion.
A ViewController manages a View and its descendants.
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.
A ViewController manages a View and its descendants.
View * view
The main view.
Class * _ViewController(void)
The ViewController archetype.
void loadView(ViewController *self)
Loads this ViewController's View.
void removeFromParentViewController(ViewController *self)
Removes this ViewController from its parent.
void setView(ViewController *self, View *view)
Sets this ViewController's View.
void addChildViewController(ViewController *self, ViewController *childViewController)
Adds the specified child ViewController to this ViewController.
void loadViewIfNeeded(ViewController *self)
Loads this ViewController's View if it is not already loaded.
ViewController * parentViewController
The parent view controller.
void viewWillAppear(ViewController *self)
This method is invoked before this ViewController's View is added to the View hierarchy.
void moveToParentViewController(ViewController *self, ViewController *parentViewController)
Moves this ViewController to the specified parent.
MutableArray * childViewControllers
The child view controllers.
void viewDidDisappear(ViewController *self)
This method is invoked after this ViewController's View is removed to the View hierarchy.
void viewWillDisappear(ViewController *self)
This method is invoked before this ViewController's View is removed from the View hierarchy.
void handleNotification(ViewController *self, const Notification *notification)
Handles a broadcast notification.
void removeChildViewController(ViewController *self, ViewController *childViewController)
Removes the specified child ViewController from this ViewController.
void viewDidAppear(ViewController *self)
This method is invoked after this ViewController's View is added to the View hierarchy.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
void updateBindings(View *self)
Updates data bindings, prompting the appropriate layout changes.
ViewController * viewController
The ViewController.
SDL_Window * window
The window.
void addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
int autoresizingMask
The ViewAutoresizing bitmask.
void removeFromSuperview(View *self)
Removes this View from its superview.
void respondToEvent(View *self, const SDL_Event *event)
Responds to the specified event.