The iOS framework that grows only as fast as its documentation
NILauncherViewController Class Reference

Overview

The NILauncherViewController class creates a controller object that manages a launcher view.

It implements the following behavior:

  • It creates an unconfigured NILauncherView object with the correct dimensions and autoresize mask. You can access this view through the launcherView property.
  • NILauncherViewController sets the data source and the delegate of the launcher view to self.
  • When the launcher view is about to appear the first time it’s loaded, the launcher-view controller reloads the launcher view’s data.
NILauncherViewControllerExample1.png
Example of an NILauncherViewController.
Inheritance diagram for NILauncherViewController:
<NILauncherDelegate> <NILauncherDataSource>

Tasks

Accessing the Launcher View
NILauncherViewlauncherView property
 
Managing Selections
(void) - launcherView:didSelectItemOnPage:atIndex:
 
Configuring a Launcher View
(NSInteger) - launcherView:numberOfButtonsInPage:
 
(UIView< NILauncherButtonView > *) - launcherView:buttonViewForPage:atIndex:
 
(NSInteger) - numberOfPagesInLauncherView:
 
(NSInteger) - numberOfRowsPerPageInLauncherView:
 
(NSInteger) - numberOfColumnsPerPageInLauncherView:
 

Method Documentation

launcherView

Returns the launcher view managed by the controller object.

@property (nonatomic, strong) NILauncherView* launcherView;

launcherView:didSelectItemOnPage:atIndex:

Informs the receiver that the specified item on the specified page has been selected.

- (void)launcherView:(NILauncherView *)launcherView didSelectItemOnPage:(NSInteger)page atIndex:(NSInteger)index;
Discussion
Parameters
launcherViewA launcher-view object informing the delegate about the new item selection.
pageA page index locating the selected item in launcher.
indexAn index locating the selected item in the given page.

launcherView:numberOfButtonsInPage:

Tells the receiver to return the number of rows in a given section of a table view (required).

- (NSInteger)launcherView:(NILauncherView *)launcherView numberOfButtonsInPage:(NSInteger)page;
Discussion
Parameters
launcherViewThe launcher-view object requesting this information.
pageThe index locating a page in launcherView.
Returns
The number of buttons in page.

launcherView:buttonViewForPage:atIndex:

Tells the receiver to return a button view for inserting into a particular location of a given page in the launcher view (required).

- (UIView<NILauncherButtonView>*)launcherView:(NILauncherView *)launcherView buttonViewForPage:(NSInteger)page atIndex:(NSInteger)index;
Discussion
Parameters
launcherViewThe launcher-view object requesting this information.
pageThe index locating a page in launcherView.
indexThe index locating a button in a page.
Returns
A UIView that conforms to NILauncherButtonView that the launcher will display on the given page. An assertion is raised if you return nil.

numberOfPagesInLauncherView:

Asks the receiver to return the number of pages in the launcher view.

- (NSInteger)numberOfPagesInLauncherView:(NILauncherView *)launcherView;
Discussion

It is assumed that the launcher view has one page if this method is not implemented.

Parameters
launcherViewThe launcher-view object requesting this information.
Returns
The number of pages in launcherView. The default value is 1.
See Also
- launcherView:numberOfButtonsInPage:

numberOfRowsPerPageInLauncherView:

Asks the receiver to return the number of rows of buttons each page can display in the launcher view.

- (NSInteger)numberOfRowsPerPageInLauncherView:(NILauncherView *)launcherView;
Discussion

This method will be called each time the frame of the launcher view changes. Notably, this will be called when the launcher view has been rotated as a result of a device rotation.

Parameters
launcherViewThe launcher-view object requesting this information.
Returns
The number of rows of buttons each page can display.
See Also
- numberOfColumnsPerPageInLauncherView:

numberOfColumnsPerPageInLauncherView:

Asks the receiver to return the number of columns of buttons each page can display in the launcher view.

- (NSInteger)numberOfColumnsPerPageInLauncherView:(NILauncherView *)launcherView;
Discussion

This method will be called each time the frame of the launcher view changes. Notably, this will be called when the launcher view has been rotated as a result of a device rotation.

Parameters
launcherViewThe launcher-view object requesting this information.
Returns
The number of columns of buttons each page can display.
See Also
- numberOfRowsPerPageInLauncherView: