Latest 1.0.0
Homepage https://github.com/immago/DBFlatPicker
License Apache-2.0
Platforms ios 9.0
Authors

podver platform license

Flat picker for iOS written on Objective-C

dbflatpicker

Installation

CocoaPods

pod 'DBFlatPicker'

Manual

Copy DBFlatPickerView.h, DBFlatPickerView.m and DBFlatPickerView.xib from Classes directory to your project.

Usage

// Uncomment if picker not created in storyboard
// self.picker = [[DBFlatPickerView alloc]initWithFrame:CGRectMake(0, 0, 300, 200)];
self.picker.data = @[@"item 1", @"item 2", @"item 3", @"item 4"];
self.picker.delegate = self;
[self.picker selectRow:2];

...

- (void)flatPickerView:(DBFlatPickerView*)flatPickerView didSelectRow:(NSInteger)row {
NSLog(@"selected row = %ld", (long)row);
}

- (void)labelStyleForFlatPickerView:(DBFlatPickerView*)flatPickerView forLabel:(UILabel*)label {
label.textColor = [UIColor blackColor];
label.font = [UIFont systemFontOfSize:20];
}

Properties

NSArray <NSString*> *data - Array of displayed NSString
CGFloat paddingLeft - Left margin of label
CGFloat paddingRight - Right margin of label
CGFloat rowHeight - Height of rows
UIColor *selectionColor - Color of selection overlay (use colors with transparency)

Delegates

/// Called when picker end row selection
- (void)flatPickerView:(DBFlatPickerView*)pickerView didSelectRow:(NSInteger)row;

/// Apply style to label
- (void)labelStyleForFlatPickerView:(DBFlatPickerView*)pickerView forLabel:(UILabel*)label;

Latest podspec

{
    "name": "DBFlatPicker",
    "version": "1.0.0",
    "summary": "Flat picker for iOS written on Objective-C",
    "description": "Flat picker, similar to UIPickerview, for iOS written on Objective-C.",
    "homepage": "https://github.com/immago/DBFlatPicker",
    "license": {
        "type": "Apache-2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Dmitry Byankin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/immago/DBFlatPicker.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Classes/**/*.{h,m}",
    "resources": [
        "Classes/DBFlatPickerView.xib"
    ]
}

Pin It on Pinterest

Share This