diff --git a/Demo/RPSlidingMenuDemo/RPSlidingMenuDemo/RPViewController.m b/Demo/RPSlidingMenuDemo/RPSlidingMenuDemo/RPViewController.m index cfd7a87..3a6f1dd 100644 --- a/Demo/RPSlidingMenuDemo/RPSlidingMenuDemo/RPViewController.m +++ b/Demo/RPSlidingMenuDemo/RPSlidingMenuDemo/RPViewController.m @@ -19,7 +19,6 @@ @implementation RPViewController - (void)viewDidLoad { [super viewDidLoad]; - } diff --git a/RPSlidingMenu/RPSlidingMenuCell.h b/RPSlidingMenu/RPSlidingMenuCell.h index 3ca1d53..340e844 100644 --- a/RPSlidingMenu/RPSlidingMenuCell.h +++ b/RPSlidingMenu/RPSlidingMenuCell.h @@ -22,14 +22,34 @@ * ***********************************************************************************/ +/** + The height of a RPSlidingCell when it is at it's full feature height. + */ extern CGFloat const RPSlidingCellFeatureHeight; -extern CGFloat const RPSlidingCellNormalHeight; +/** + The height of a RPSlidingCell when it is at it's normal height. + */ +extern CGFloat const RPSlidingCellNormalHeight; +/** + RPSlidingMenu is a subclass of UICollectionViewCell that is used for displaying rows in a RPSlidingMenuViewController. It has a textLabel that can be set to show a header title for the cell. It also has a detailTextLabel where a longer description can follow the textLabel header. The backgroundImageView allows an image to be set behind it. This cell has text that fades and shrink as it goes from feature height to normal height + */ @interface RPSlidingMenuCell : UICollectionViewCell +/** + The topmost centered label that is used like a header for the cell. The label grows as it approaches feature height + */ @property (strong, nonatomic) UILabel *textLabel; + +/** + The bottommost centered label that is used for a description for the cell. The label fades in as it approaches feature height + */ @property (strong, nonatomic) UILabel *detailTextLabel; + +/** + The background image view of the cell. Set this to supply an image that is centered in the cell. It is covered by a black view that has varying alpha depending on the cell size. + */ @property (strong, nonatomic) UIImageView *backgroundImageView; @end diff --git a/RPSlidingMenu/RPSlidingMenuLayout.h b/RPSlidingMenu/RPSlidingMenuLayout.h index 0679b22..dbad1ad 100644 --- a/RPSlidingMenu/RPSlidingMenuLayout.h +++ b/RPSlidingMenu/RPSlidingMenuLayout.h @@ -24,7 +24,9 @@ #import - +/** + RPSlidingMenuLayout is a subclass of UICollectionViewLayout that is used to determine the current layout of the RPSlidingMenu. It calculates the frames necessary to make the sliding/growing cell effect. + */ @interface RPSlidingMenuLayout : UICollectionViewLayout @end diff --git a/RPSlidingMenu/RPSlidingMenuViewController.h b/RPSlidingMenu/RPSlidingMenuViewController.h index 471ff9d..c8f8b6d 100644 --- a/RPSlidingMenu/RPSlidingMenuViewController.h +++ b/RPSlidingMenu/RPSlidingMenuViewController.h @@ -25,11 +25,37 @@ #import #import "RPSlidingMenuCell.h" - +/** + RPSlidingMenuViewController is a subclass of UICollectionViewController that is supplies methods that can be overridden to supply the number of items in the menu, customize the menu cell and also to react to a menu item being tapped. + */ @interface RPSlidingMenuViewController : UICollectionViewController +/** + Returns the number of items(cells) that are in the sliding menu. + + @return the number of rows desired in the RPSlidingMenu + + */ - (NSInteger)numberOfItemsInSlidingMenu; + +/** + Gives you a chance to customize the cell at the given row. To set a header set the textLabel.text, a description goes in the detailTextlabel.text and background image in backgroundImageView.image. + + @param slidingMenuCell The RPSlidingMenuCell that will be displayed at that row and can be customized at this point. + + @param row The row that relates to the data being shown. + + */ - (void)customizeCell:(RPSlidingMenuCell *)slidingMenuCell forRow:(NSInteger)row; + +/** + Called when one of the rows in the RPSlidingMenu is tapped. + + @param slidingMenu the sliding menu that called this. + + @param row The row that relates to the data on the row that was tapped. + + */ - (void)slidingMenu:(RPSlidingMenuViewController *)slidingMenu didSelectItemAtRow:(NSInteger)row; @end