Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

duffpod/DFPickerView

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFPickerView

Version Platform

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

DFPickerView is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "DFPickerView"

Author

duffpod, duffpod@gmail.com

License

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

About

A simple picker view with tool bar and blocks.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.