PopOverDatePicker

1.1.0

PopOverDatePicker is a PopOver style DatePicker view.
tichise/PopOverDatePicker

What's New

1.1.0

2020-09-25T09:29:00Z

PopOverDatePicker CocoaPods Version Platform License

PopOverDatePicker is a PopOver style DatePicker view.

Image

iPhone

image

Examples

for Swift

        let calendar = Calendar.current
        let date = Date()
        guard let yesterday = calendar.date(byAdding: .day, value: -1, to: calendar.startOfDay(for: date)) else {
            fatalError()
        }

        guard let tomorrow = calendar.date(byAdding: .day, value: +1, to: calendar.startOfDay(for: date)) else {
            fatalError()
        }

        let popOverDatePickerViewController = PopOverDatePickerViewController.instantiate()
        popOverDatePickerViewController.set(date: date)
        popOverDatePickerViewController.set(minimumDate: yesterday)
        popOverDatePickerViewController.set(maximumDate: tomorrow)
        popOverDatePickerViewController.set(datePickerMode: .date)
        popOverDatePickerViewController.set(locale: Locale(identifier: "ja-JP"))
        popOverDatePickerViewController.popoverPresentationController?.barButtonItem = sender
        popOverDatePickerViewController.presentationController?.delegate = self
        popOverDatePickerViewController.changeHandler = { (date: Date) -> Void in
            print(date)
        }
        present(popOverDatePickerViewController, animated: true, completion: nil)

Installation (CocoaPods)

pod PopOverDatePicker

CocoaPods URL

License

PopOverDatePicker is available under the MIT license. See the LICENSE file for more info.

Description

  • Swift Tools 3.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Oct 19 2024 08:02:28 GMT-0900 (Hawaii-Aleutian Daylight Time)