TCXMenu
is an easy-to-use menu. Reference kxmenu effect
# Your Podfile
platform :ios, '7.0'
pod 'YCXMenu', '~> 0.0.3'
- Drag the
YCXMenu
folder into your project. - Add the QuartzCore framework to your project.
//set title
YCXMenuItem *menuTitle = [YCXMenuItem menuTitle:@"Menu" WithIcon:nil];
menuTitle.foreColor = [UIColor whiteColor];
menuTitle.titleFont = [UIFont boldSystemFontOfSize:20.0f];
//set logout button
YCXMenuItem *logoutItem = [YCXMenuItem menuItem:@"Logout" image:nil target:self action:@selector(logout:)];
logoutItem.foreColor = [UIColor redColor];
logoutItem.alignment = NSTextAlignmentCenter;
NSArray *items = @[menuTitle,
[YCXMenuItem menuItem:@"UserCenter"
image:nil
tag:100
userInfo:@{@"title":@"Menu"}],
[YCXMenuItem menuItem:@"CheckOut"
image:nil
tag:102
userInfo:@{@"title":@"Menu"}],
logoutItem
];
[YCXMenu showMenuInView:self.view fromRect:btn.frame menuItems:items selected:^(NSInteger index, YCXMenuItem *item) {
NSLog(@"%@",item);
}];
##Change
###0.0.3
- 添加
+(BOOL)isShow
方法, 可以根据此方法手动控制YCXMenu的显示和隐藏; - Add function
+(BOOL)isShow
, you can set show or hide YCXMenu expediently;
MIT License.