levey/AwesomeMenu — pull request #59 by shingo-minamiyama (2014-12-15 16:45:53+00:00)
Title: Support Autolayout on Storyboard

Support Autolayout on Storyboard. Now it's support initWithCoder() and we can use IBOutlet like follow:

foo.h

@property (weak, nonatomic) IBOutlet AwesomeMenu *awesomeMenu;

To use this, insert an UIView object on Storyboard and change [custom class] class field from [UIView] to [AwesomeMenu].
Then you must link from Referencing Outlets to IBOutlet.
It can be controlled under Autolayout rules, you may add constraint(s) to this custom component on Storyboard.

foo.m

@synthesize awesomeMenu;

AwesomeMenuItem *menuItem1 = [[AwesomeMenuItem alloc] initWithImage:
...
highlightedContentImage:nil];
...
NSArray *menus = [NSArray arrayWithObjects:menuItem1, menuItem2, menuItem3, menuItem4, nil];

AwesomeMenuItem *startItem = [[AwesomeMenuItem alloc] initWithImage:
....
highlightedContentImage:[UIImage imageNamed:@"icon-plus-highlighted.png"]];
[awesomeMenu setStartButton:startItem];
[awesomeMenu setMenusArray:menus];

We can't call initWithFrame() in Storyboard layout style, I make setStartButton() and setMenusArray() to set start button and menus easily.