Click here to support Nimbus development and make a donation at www.pledgie.com !
An iOS framework whose growth is bounded by O(documentation).
NILauncherViewController Class Reference

Overview

A view controller that displays a launcher view and implements its protocols.

This view controller may be used in production, though you'll likely want to subclass it and internalize the loading of the pages. You can also simply use this controller as an example and write a completely new view controller or add the launcher view to an existing view controller if that suits your situation better.

By default this controller implements the numberOfRowsPerPageInLauncherView and numberOfColumnsPerPageInLauncherView methods of the launcher data source. The following values are given depending on the device:

 iPhone:
   Portrait: 3x3 (row by column)
   Landscape: 5x2
 iPad:
   4x5
 

You may choose to allow the launcher to determine the number of icons to be shown on its own. If you choose to do so, make these methods return NILauncherViewDynamic.

By default this controller does not allow the launcher to be shown in landscape mode on the iPhone or iPod touches. This is due largely to the complex nature of handling the different number of icons that can be displayed in each orientation. For example, on the iPhone in portrait with the default grid definitions as noted above, you can see 9 icons, whereas in landscape you can see 10. There are things you can do to make this work, of course, but barring an elegant solution I've elected to disable this functionality by default in this controller.

NILauncherViewControllerExample1.png
Example of an NILauncherViewController as seen in the BasicLauncher demo application.

Definition at line 67 of file NILauncherViewController.h.

Inheritance diagram for NILauncherViewController:
<NILauncherDelegate> <NILauncherDataSource>

Methods

NSArray * pages property
(void) - launcherView:didSelectButton:onPage:atIndex:
(CGSize) - buttonDimensionsInLauncherView:
(NSInteger) - numberOfRowsPerPageInLauncherView:
(NSInteger) - numberOfColumnsPerPageInLauncherView:
(NSInteger) - numberOfPagesInLauncherView:
(NSInteger) - launcherView:numberOfButtonsInPage:
(UIButton *) - launcherView:buttonForPage:atIndex:
Subclassing

The following methods are provided to aid in subclassing and are not meant to be used externally.

(Class) - launcherButtonClass

Method Documentation

- (NSArray *) pages [read, write, copy]

An array of arrays of NILauncherItemDetails.

These pages are used to populate the launcher view via the NILauncherDataSource protocol.

Note:
This is an NSArray - not an NSMutableArray - because you should not directly modify the contents of the pages after they have been stored in this view controller. If you need to modify the pages after assigning them here, you should assign a new set of pages.

Definition at line 86 of file NILauncherViewController.h.

- (Class) launcherButtonClass

The launcher button view class.

Must be a subclass of UIButton.

Provided here for subclasses to use as a convenience for changing the launcher button class.

Defaults to NILauncherButton.

Definition at line 167 of file NILauncherViewController.m.

- (void) launcherView: (NILauncherView *)  launcher
didSelectButton: (UIButton *)  button
onPage: (NSInteger)  page
atIndex: (NSInteger)  index 
[optional, inherited]

Called when the user taps and releases a launcher button.

- (CGSize) buttonDimensionsInLauncherView: (NILauncherView *)  launcherView [optional, inherited]

Override the default button dimensions 80x80.

The default dimensions will fit the following grids:

iPhone within a navigation controller Portrait: 3x4 Landscape: 5x2

The returned dimensions must be positive non-zero values.

- (NSInteger) numberOfRowsPerPageInLauncherView: (NILauncherView *)  launcherView [optional, inherited]

Override the default number of rows which is dynamically calculated.

- (NSInteger) numberOfColumnsPerPageInLauncherView: (NILauncherView *)  launcherView [optional, inherited]

Override the default number of columns which is dynamically calculated.

- (NSInteger) numberOfPagesInLauncherView: (NILauncherView *)  launcherView [required, inherited]

The total number of pages to be shown in the launcher view.

- (NSInteger) launcherView: (NILauncherView *)  launcherView
numberOfButtonsInPage: (NSInteger)  page 
[required, inherited]

The total number of buttons in a given page.

- (UIButton *) launcherView: (NILauncherView *)  launcherView
buttonForPage: (NSInteger)  page
atIndex: (NSInteger)  index 
[required, inherited]

Retrieve the button to be displayed at a given page and index.

Generated for Nimbus by doxygen 1.7.4-20110629