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

Overview

An object for efficiently reusing views by recycling and dequeuing them from a pool of views.

This sort of object is likely what UITableView and NIPagingScrollView use to recycle their views.

Tasks

(UIView< NIRecyclableView > *) - dequeueReusableViewWithIdentifier:
 
(void) - recycleView:
 
(void) - removeAllViews
 

Method Documentation

dequeueReusableViewWithIdentifier:

Dequeues a reusable view from the recycled views pool if one exists, otherwise returns nil.

- (UIView<NIRecyclableView>*)dequeueReusableViewWithIdentifier:(NSString *)reuseIdentifier;
Discussion
Parameters
reuseIdentifierOften the name of the class of view you wish to fetch.

recycleView:

Adds a given view to the recycled views pool.

- (void)recycleView:(UIView<NIRecyclableView> *)view;
Discussion
Parameters
viewThe view to recycle. The reuse identifier will be retrieved from the view via the NIRecyclableView protocol.

removeAllViews

Removes all of the views from the recycled views pool.

- (void)removeAllViews;