Skip to content

iballan/ios-picker-dialog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swift 3 Version of PickerDialog

PickerDialog

PickerDialog is a customizable class that displays a UIPickerView in a dialog for iOS apps.

Demo screen

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("Distance units", options: pickerData, selected: "kilometer") {
        (value) -> Void in

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

Parameters

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

Special thanks to

License

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

About

A pretty picker dialog for iOS in Swift 3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%