Pop-up view similar to the Tumblr publish button
The use is simple:
Initialization
@property (nonatomicstrong) XWMenuPopView *myMenuPopView;- (void)viewDidLoad { [super//将弹出菜单视图添加到主视图 _myMenuPopView = [[XWMenuPopView alloc] initWithFrame:self.view.frame]; [_myMenuPopView setMenuPopDelegate:self]; [self.view addSubview:_myMenuPopView]; }
Use:
#pragma mark - 弹出菜单监听方法-(void)ShowMenuPopView:(UIButton *)menuPopBtn { [_myMenuPopView showMenu];}
Agent
#pragmaMenuPopDelegate 代理方法-(void)XWMenuPopView:(XWMenuPopView *)MenuPopView didSelectedMenuIndex:(NSInteger)selectedIndex{ NSLog(@"->>didSelectedMenuIndex->>点击的是第%ld个按钮",selectedIndex);}
Note two points:
/* If the popup view is not displayed at the front end, you can /
[Self.view Bringsubviewtofront:_mymenupopview];
If the pop-up view is in a custom Uitabbarcontroller encapsulated controller, you need to add Xwmenupopview in the Uitabbarcontroller child view
source File Download:
Https://github.com/qxuewei/XWMenuPopView
ios-a popup menu animation view open Source project sharing