Compiled Chronicles

A software development blog by Angelo Villegas

iOS: AVPickerDimView

AVPickerDimView is a simple class combination of UIView, UIActionSheet, and UIPickerView.

Installation

There are 3 ways to download and import the files to your project:

Download:

  1. Using git subtree (recommended)
    • git subtree add --prefix=AVPickerDimView --squash [email protected]:anjerodesu/AVPickerDimView.git master
  2. Using git submodule
  3. Download as zip

After downloading and importing the files to your project folder, your next step is setting it up:

Xcode:

  • Drag and drop AVPickerDimView-Demo.xcodeproj to your project (either root or under the Frameworks group)
  • Project configuration:
    • Build Phases:
      • Add AVPickerDimView as a Target Dependency
      • Add libAVPickerDimView.a in the Link Binaries With Library
    • Build Settings:
      • Locate User Header Search Paths and add ${PROJECT_DIR}/AVPickerDimView and choose recursive.
      • Locate Always Search User Paths and set it to YES.
      • Locate Other Linker Flags and add the value -ObjC.
  • Import the library to your project using #import <AVPickerDimView/AVPickerKit.>

Usage

Object initialisation:

AVPickerDimView *pickerDimView = [[AVPickerDimView alloc] initWithFrame: self.view.bounds];
pickerDimView.dataSource = self;
pickerDimView.delegate = self;

[self.view addSubview: pickerDimView];

Checking if AVPickerDimView is present:

[pickerDimView isAVPickerPresent]

Showing and Hiding AVPickerDimView

if ( [pickerDimView isAVPickerPresent] )
{
    [pickerDimView hideAVPickerDimView];
}
else
{
    [pickerDimView showAVPickerDimView];
}

License

AVPickerDimView is available under the MIT license.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *