Skip to content

priore/DPPickerManager

Repository files navigation

DPPickerManager

Stars Forks Version License Language Supports Platform Twitter: @DaniloPriore

UIPicker inside a UIAlertController

HOW TO USE :

// Strings Picker
let values = ["Value 1", "Value 2", "Value 3", "Value 4"]
DPPickerManager.shared.showPicker(title: "Strings Picker", selected: "Value 1", strings: values) { (value, index, cancel) in
    if !cancel {
        // TODO: you code here
        debugPrint(value as Any)
    }
}
// Date Picker
let min = Date()
let max = min.addingTimeInterval(31536000) // 1 year
DPPickerManager.shared.showPicker(title: "Date Picker", selected: Date(), min: min, max: max) { (date, cancel) in
    if !cancel {
        // TODO: you code here
        debugPrint(date as Any)
    }
}
// Time Picker (custom picker)
DPPickerManager.shared.showPicker(title: "Time Picker", picker: { (picker) in
    picker.date = Date()
    picker.datePickerMode = .time
}) { (date, cancel) in
    if !cancel {
        // TODO: you code here
        debugPrint(date as Any)
    }
}

Support Development

If this project has been helpful to you, please consider making a small donation. Your support is crucial for funding new features, covering hosting costs, or simply buying me a coffee! Every contribution, big or small, is highly appreciated.

Scan the code below with your cryptocurrency wallet or copy the address.

Donate with BTC (Bitcoin)
BTC Address (SegWit) : bc1q6mxjea7xfjprl70k80jt8gyqxjvp5j6pa9yzxs

About

UIPicker inside a UIAlertController

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published