FTPickerView
A simple UIPickerView/UIDatePicker wrapper.
Features
- singleton
- block callbacks
ScreenShots
Useage
- Simple Picker
//simple picker
[FTPickerView showWithTitle:@"Choose a step"
nameArray:self.optionArrayOne
doneBlock:^(NSInteger selectedIndex) {
[sender setTitle:_optionArrayOne[selectedIndex] forState:UIControlStateNormal];
} cancelBlock:^{
}];
- Date Picker
//date picker
[FTDatePickerView showWithTitle:@"Choose a date"
selectDate:nil
datePickerMode:UIDatePickerModeDateAndTime
doneBlock:^(NSDate *selectedDate) {
NSDateFormatter *dateFormate = [[NSDateFormatter alloc]init];
[dateFormate setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
[sender setTitle:[dateFormate stringFromDate:selectedDate] forState:UIControlStateNormal];
} cancelBlock:^{
}];
Installation
Manual
- Drag 'FTPickerView' file to you project,
- Import 'FTPickerView.h',
- Enjoy!
🍺
Cocoapods
- add the following line to you podFile,then
pod update
pod 'FTPickerView', '~> 0.1.1'
License
FTPickerView is available under the MIT license. See the LICENSE file for more info.