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

Overview

The NITableViewSnapshotRotation class implements the fixedInsetsForSnapshotRotation: delegate method and forwards all other delegate methods along.

If you are rotating a UITableView you can instantiate a NITableViewSnapshotRotation object and use it just like you would a snapshot rotation object. The NITableViewSnapshotRotation class intercepts the fixedInsetsForSnapshotRotation: method and returns insets that map to the dimensions of the content view for the first visible cell in the table view.

The assigned delegate only needs to implement containerViewForSnapshotRotation: and rotatingViewForSnapshotRotation:.

Inheritance diagram for NITableViewSnapshotRotation:
NISnapshotRotation

Tasks

Accessing the Delegate
id< NISnapshotRotationDelegatedelegate property
 
Creating a Snapshot Rotation Object
(id) - initWithDelegate:
 
Implementing UIViewController Autorotation
(void) - willRotateToInterfaceOrientation:duration:
 
(void) - willAnimateRotationToInterfaceOrientation:duration:
 
(void) - didRotateFromInterfaceOrientation:
 

Method Documentation

delegate

The delegate of the snapshot rotation object.

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

The delegate must adopt the NISnapshotRotation protocol. The NISnapshotRotation class, which does not retain the delegate, invokes each protocol method the delegate implements.

initWithDelegate:

Initializes a newly allocated rotation object with a given delegate.

- (id)initWithDelegate:(id<NISnapshotRotationDelegate>)delegate;
Discussion
Parameters
delegateA delegate that implements the NISnapshotRotation protocol.
Returns
A NISnapshotRotation object initialized with delegate.

willRotateToInterfaceOrientation:duration:

Prepares the animation for a rotation by taking a snapshot of the rotatingView in its current state.

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

This method must be called from your UIViewController implementation.

willAnimateRotationToInterfaceOrientation:duration:

Crossfades between the initial and final snapshots.

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

This method must be called from your UIViewController implementation.

didRotateFromInterfaceOrientation:

Finalizes the rotation animation by removing the snapshot views from the container view.

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation;
Discussion

This method must be called from your UIViewController implementation.