UIAPPicker 是在不需要使用UIActionSheet的情况下,以简单方式在选定的视图中显示自定义UIPicker的方法。
platform :ios, '6.1'
pod "UIAPPicker"
@property (strong, nonatomic) UIAPPicker *apPicker;
- (UIAPPicker *)apPicker
{
if (!_apPicker) {
_apPicker = [UIAPPicker pickerForView:self.view delegate:self];
}
return _apPicker;
}
[self.apPicker show:@[@"Moscow", @"New York", @"Paris", @"Berlin", @"Ankara"] withSelectedRow:0];
@protocol UIAPPickerDelegate
- (void)pickerDidCancel:(UIAPPicker *)anPicker;
- (void)picker:(UIAPPicker *)anPicker didSelectItem:(id)anItem;
@end
UIAPPicker遵循MIT许可协议。有关更多信息,请参阅LICENSE文件。