仅需一行代码就可以完成一个单行选择/多行选择View
//数据源
NSMutableArray *arr = [NSMutableArray array];
for (int i = 0; i < 20; i++) {
[arr addObject:[NSString stringWithFormat:@"数据--%d",i]];
}
//添加单行选择View
JYSelectView *view = [[JYSelectView alloc]initWithTitleArray:arr
style:JYSingleSelect
animated:YES];
[self.view addSubview:view];
//数据源
NSMutableArray *arr = [NSMutableArray array];
for (int i = 0; i < 40; i++) {
[arr addObject:[NSString stringWithFormat:@"数据--%d",i]];
}
//添加单行选择View
JYSelectView *view = [[JYSelectView alloc]initWithTitleArray:arr
style:JYMultipleSelect
animated:YES
completionHandler:^{
// 点击确定时执行
}];
view.hintInfo = @"点击您喜爱的几个选项:";
view.hintInfoColor = [UIColor redColor];
view.okButtonColor = [UIColor blueColor];
view.cancelButtonColor = [UIColor redColor];
[self.view addSubview:view];