Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A UIPickerView that pops up, just like the facebook app.
Objective-C Ruby
branch: master
Failed to load latest commit information.
CEPopupPickerView.xcodeproj Refactoring
CEPopupPickerView Refactoring
CEPopupPickerViewIntegrationTests Initial commit
.gitignore Initial commit
CEPopupPickerView copy-Info.plist
LICENSE Removed old comments
Podfile Initial commit
README.md Refactoring

README.md

CEPopupPickerView

CEPopupPickerView is a library that shows a UIPickerView at the bottom of the screen, just like the Facebook app. When the users taps outside the UIPickerView or taps the selected row, the popup dismisses and calls the delegate.

Installation

CEPopupPickerView is best installed via CocoaPods. Alternatively, you can drag the CEPopupPickerView/CEPopupPickerView.{h,m} files into your project.

Usage

Add an instance variable to your view controller to make sure you keep a reference:

CEPopupPickerView* popupPicker;

Put this somewhere in your view controller:

NSArray* values = [NSArray arrayWithObjects:@"Don", @"Peggy", @"Pete", nil];
popupPicker = [[CEPopupPickerView alloc] initWithValues:values callback:^(NSInteger selectedIndex) {
        NSLog(@"you chose: %@", [values objectAtIndex:selectedIndex]);
}];
[popupPicker presentInView:self.view];

If you want to run an example, clone this project and open the XCode Project.

For now, the view only works in portrait mode on the iPhone, but patches for landscape mode are more than welcome. An iPad port isn't planned, as it is probably better to put a UIPickerView inside a UIPopover.

Tests

To run the tests, clone this project. Then run

    pod install CEPopupPickerView

This will generate a CEPopupPickerView.xcworkspace, which you can then open. Run the target "Integration Tests". The tests use KIF and can be found in the group CEPopupPickerViewIntegrationTests.

Something went wrong with that request. Please try again.