A custom view component that presents a UIPickerView with a simple list of options, along with a toolbar for Done/Cancel and a faded backdrop view.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 33 commits behind subdigital:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
BSModalPickerView.h
BSModalPickerView.m
BSModalPickerView.podspec
LICENSE
README.md

README.md

BSModalPickerView

A custom view component that presents a UIPickerView with a simple list of options, along with a toolbar for Done/Cancel and a faded backdrop view.

Usage

Usage is easy:

Add the dependency to your Podfile:

platform :ios
pod 'BSModalPickerView'
...

Run pod install to install the dependencies.

Next, import the header file wherever you want to use the picker:

#import "BSModalPickerView.h"

Finally, present the picker when necessary (say on a button touch handler):

self.values = @[ @"Apples", @"Bananas", @"Grapes" ];
BSModalPickerView *picker = [[PSModalPickerView alloc] initWithValues:self.values];
[picker presentInView:self.view withBlock:^(BOOL madeChoice) {
  if (madeChoice) {
    NSLog(@"You chose index %d, which was the value %@", 
      picker.selectedIndex,
      picker.selectedValue);
  } else {
    NSLog(@"You cancelled the picker");
  }
}];

Requirements

BSModalPickerView requires iOS 4.x or greater.

License

Usage is provided under the MIT License. See LICENSE for the full details.