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

Overview

A launcher view that simulates iOS' home screen launcher functionality.

Tasks

Configuring a Launcher View
NSInteger maxNumberOfButtonsPerPage property
 
UIEdgeInsets contentInsetForPages property
 
CGSize buttonSize property
 
NSInteger numberOfRows property
 
NSInteger numberOfColumns property
 
(UIView< NILauncherButtonView > *) - dequeueReusableViewWithIdentifier:
 
Managing the Delegate and the Data Source
id< NILauncherDelegatedelegate property
 
id< NILauncherDataSourcedataSource property
 
Reloading the Table View
(void) - reloadData
 
Rotating the Launcher View
(void) - willRotateToInterfaceOrientation:duration:
 
(void) - willAnimateRotationToInterfaceOrientation:duration:
 

Method Documentation

maxNumberOfButtonsPerPage

The maximum number of buttons allowed on a given page.

@property (nonatomic) NSInteger maxNumberOfButtonsPerPage;
Discussion

By default this value is NSIntegerMax.

contentInsetForPages

The distance that each page view insets its contents.

@property (nonatomic) UIEdgeInsets contentInsetForPages;
Discussion

Use this property to add to the area around the content of each page. The unit of size is points. The default value is 10 points on all sides.

buttonSize

The size of each launcher button.

@property (nonatomic) CGSize buttonSize;

numberOfRows

The number of rows to display on each page.

@property (nonatomic) NSInteger numberOfRows;

numberOfColumns

The number of columns to display on each page.

@property (nonatomic) NSInteger numberOfColumns;

delegate

The object that acts as the delegate of the receiving launcher view.

@property (nonatomic, weak) id<NILauncherDelegate> delegate;
Discussion

The delegate must adopt the NILauncherDelegate protocol. The delegate is not retained.

dataSource

The object that acts as the data source of the receiving table view.

@property (nonatomic, weak) id<NILauncherDataSource> dataSource;
Discussion

The data source must adopt the NILauncherDataSource protocol. The data source is not retained.

reloadData

Reloads the pages of the receiver.

- (void)reloadData;
Discussion

Call this method to reload all the data that is used to construct the launcher, including pages and buttons. For efficiency, the launcher redisplays only those pages that are visible or nearly visible.

dequeueReusableViewWithIdentifier:

Returns a reusable launcher button view object located by its identifier.

- (UIView<NILauncherButtonView>*)dequeueReusableViewWithIdentifier:(NSString *)identifier;
Discussion
Parameters
identifierA string identifying the launcher button view object to be reused. By default, a reusable view's identifier is its class name, but you can change it to any arbitrary value.
Returns
A UIView object with the associated identifier that conforms to the NILauncherButtonView protocol, or nil if no such object exists in the reusable-cell queue.

willRotateToInterfaceOrientation:duration:

Stores the current state of the launcher view in preparation for rotation.

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
Discussion

This must be called in conjunction with willAnimateRotationToInterfaceOrientation:duration: in the methods by the same name from the view controller containing this view.

willAnimateRotationToInterfaceOrientation:duration:

Updates the frame of the launcher view while maintaining the current visible page's state.

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;