https://github.com/wyanassert/wygeneralpicker
General Picker of iOS develop.
https://github.com/wyanassert/wygeneralpicker
objective-c picker
Last synced: about 1 year ago
JSON representation
General Picker of iOS develop.
- Host: GitHub
- URL: https://github.com/wyanassert/wygeneralpicker
- Owner: wyanassert
- License: mit
- Created: 2018-05-11T02:33:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-21T09:09:57.000Z (about 8 years ago)
- Last Synced: 2025-04-30T23:48:28.581Z (about 1 year ago)
- Topics: objective-c, picker
- Language: Objective-C
- Size: 388 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://cocoapods.org/pods/WYGeneralPicker)
[](https://cocoapods.org/pods/WYGeneralPicker)
[](http://cocoadocs.org/docsets/WYGeneralPicker)
## WYGeneralPicker
Support DatePicker, StringPicker and MultipleStringPicker.
A simple replacement of [ActionSheetPicker-3.0](https://github.com/skywinder/ActionSheetPicker-3.0)
* Why not use `ActionSheetPicker-3.0`?
see the issue [ActionSheetPicker popover selection is not working for iPad on iOS 11+](https://github.com/skywinder/ActionSheetPicker-3.0/issues/384). So I just want to replace `ActionSheetPicker-3.0` easily if the issue not fixed.
---
### How To Use
1. first step
`pod WYGeneralPicker`
and then
`#import "ViewController.h"`
2. present Picker using code below
```
// DatePicker
[WYGeneralPicker showPickerWithTitle:@"Select Date" datePickerMode:UIDatePickerModeDateAndTime selectedDate:[NSDate date] minimumDate:[NSDate dateWithTimeIntervalSinceNow:-(3600*24 * 3)] maximumDate:[NSDate dateWithTimeIntervalSinceNow:(3600*24 * 3)] doneBlock:^(NSDate *date) {
} cancelBlock:^{
}];
```
```
// StringPicker
NSUInteger index = [[NSTimeZone knownTimeZoneNames] indexOfObject:[NSTimeZone localTimeZone].name];
[WYGeneralPicker showPickerWithTitle:@"Time Zone" rows:[NSTimeZone knownTimeZoneNames] initialSelection:index doneBlock:^(NSString *selectedStr) {
} cancelBlock:^{
}];
```
```
// MultipleStringPicker
[WYGeneralPicker showPickerWithTitle:@"Multiple Title" multipleRows:@[@[@"row0", @"row1", @"row0", @"row1", @"row0", @"row1"],
@[@"row2", @"row3", @"row4", @"row2", @"row3", @"row4"],
@[@"row5", @"row6", @"row7", @"row8", @"row9", @"row0"]]
initialSelections:@[@(2), @(5), @(0)] doneBlock:^(NSArray *selectedStrArray) {
} cancelBlock:^{
}];
```
### Screenshots


