Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.56 KB

README.md

File metadata and controls

51 lines (36 loc) · 1.56 KB

PickerDialog

I add update for display callback PickerDialog is a customizable class that displays a UIPickerView in a dialog for iOS apps. This project builds on DatePickerDialog-iOS-Swift, a date picker dialog developed by Squimer.

Demo screen

Swift Version

This project is using swift version 5

Adding to your project

Copy the PickerDialog.swift file into your project. Modify to fit your needs.

Example Usage

func buttonTapped() {
    let pickerData = [
        ["value": "mile", "display": "Miles (mi)"],
        ["value": "kilometer", "display": "Kilometers (km)"]
    ]
    PickerDialog().show(title: "Distance units", options: pickerData, selected: "kilometer") {
        (value, display) -> Void in

        print("Unit selected: \(value), display: \(display)")
    }
}

Parameters

  • title: String (Required)
  • doneButtonTitle: String
  • cancelButtonTitle: String
  • selected: String (Default picker value)
  • callback: ((value: String, display: String) -> Void) (Required)

Forked from

Special thanks to

License

This code is distributed under the terms and conditions of the MIT license.