Skip to content

Commit

Permalink
Added documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Thorsteinson committed Mar 13, 2014
1 parent f76c585 commit 9268223
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ @implementation RPViewController
- (void)viewDidLoad
{
[super viewDidLoad];

}


Expand Down
22 changes: 21 additions & 1 deletion RPSlidingMenu/RPSlidingMenuCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion RPSlidingMenu/RPSlidingMenuLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

#import <UIKit/UIKit.h>


/**
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
28 changes: 27 additions & 1 deletion RPSlidingMenu/RPSlidingMenuViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,37 @@
#import <UIKit/UIKit.h>
#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

0 comments on commit 9268223

Please sign in to comment.