Skip to content

Commit

Permalink
Add menuItemAtIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
lvyzhu committed Feb 26, 2015
1 parent b55e5cd commit 2998b95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Binary file not shown.
2 changes: 2 additions & 0 deletions AwesomeMenu/AwesomeMenu/AwesomeMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

- (id)initWithFrame:(CGRect)frame startItem:(AwesomeMenuItem*)startItem optionMenus:(NSArray *)aMenusArray DEPRECATED_MSG_ATTRIBUTE("use -initWithFrame:startItem:menuItems: instead.");

- (AwesomeMenuItem *)menuItemAtIndex:(NSUInteger)index;

@end

@protocol AwesomeMenuDelegate <NSObject>
Expand Down
10 changes: 9 additions & 1 deletion AwesomeMenu/AwesomeMenu/AwesomeMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (void)setStartPoint:(CGPoint)aPoint
self.startButton.center = aPoint;
}

#pragma mark - images
#pragma mark - Images

- (void)setImage:(UIImage *)image {
self.startButton.image = image;
Expand Down Expand Up @@ -221,6 +221,14 @@ - (void)setMenuItems:(NSArray *)menuItems
}
}

- (AwesomeMenuItem *)menuItemAtIndex:(NSUInteger)index
{
if (index >= [self.menuItems count]) {
return nil;
}
return self.menuItems[index];
}

- (void)_setMenu {
NSUInteger count = [self.menuItems count];
for (int i = 0; i < count; i ++)
Expand Down

0 comments on commit 2998b95

Please sign in to comment.