DFPickerView 0.0.2

DFPickerView 0.0.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



  • By
  • duffpod

Usage

__block NSMutableArray *array = [NSMutableArray array];

@autoreleasepool {

    for(int i = 1;i < 100;i++) {

        [array addObject:[NSNumber numberWithInteger:i]];

    }

}

self.pickerView = [[DFPickerView alloc] initWithStyle:DFPickerViewStyleDark]; // DFPickerViewStyleLight
self.pickerView.animationDuration = 0.30f; // defaults to 0.23f
[self.view addSubview:self.pickerView];

[self.pickerView showInView:self.view withAnimations:nil completion:nil objects:array converter:^NSString *(id object) {

    return [[object stringValue] stringByAppendingString:@" pcs."];

} selection:^(NSInteger selectedIndex, id selectedObject) {

    NSLog(@"Selecting object: %@ at index: %i", selectedObject, selectedIndex);

} cancel:^{

    array = nil;
    self.pickerView = nil;

    NSLog(@"Cancelled");

} done:^(NSInteger selectedIndex, id selectedObject) {

    array = nil;
    self.pickerView = nil;

    NSLog(@"Completed with object: %@ at index: %i", selectedObject, selectedIndex);

}];

Requirements

iOS 7 and later.

Installation

Author

duffpod, [email protected]

License

DFPickerView is available under the MIT license. See the LICENSE file for more info.