控制器,用于显示可选择的项列表。
复制 BWSelectViewController 目录到您的项目中。
或者用 Cocoapods
pod 'BWSelectViewController', :git => "https://github.com/brunow/BWSelectViewController.git", :tag => "0.4.3"
BWSelectViewController *vc = [[BWSelectViewController alloc] init];
vc.items = [NSArray arrayWithObjects:@"Item1", @"Item2", @"Item3", @"Item4", nil];
vc.multiSelection = NO;
vc.allowEmpty = YES;
[vc setDidSelectBlock:^(NSArray *selectedIndexPaths, BWSelectViewController *controller) {
NSLog(@"%@", selectedIndexPaths);
}];
[self.navigationController pushViewController:vc animated:YES];
BWSelectViewController 仅支持 ARC。