这是一个可以自定义PopView各种属性的极简控件
@property (strong, nonatomic) MOTPopConfig *config;
self.config = [MOTPopConfig new];
self.config.size = CGSizeMake(60, 100);
self.config.targetView = self.button;
self.config.isAuto = NO;
self.config.tabColor = [UIColor blackColor];
UILabel *label1 = [UILabel new];
label1.textColor = [UIColor whiteColor];
label1.text = [NSString stringWithFormat:@"%d", _i];
label1.textAlignment = NSTextAlignmentCenter;
[self.config addView:label1];
- (IBAction)click:(id)sender {
__weak typeof(self) mySelf = self;
[MOTMutablePopView popWithConfig:self.config ClickIndexBlock:^(NSUInteger index) {
mySelf.showLabel.text = [NSString stringWithFormat:@"选择了第%lu个", (unsigned long)index];
}];
}