You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DatePickerDialog is an iOS drop-in classe that displays an UIDatePicker within an UIAlertView.
Requirements
DatePickerDialog works on iOS 7, 8 and 9, 10, 11, 12, 13 and 14. It depends on the following Apple frameworks, which should already be included with most Xcode templates:
Foundation
UIKit
Swift Versions
Swift 5.3 (Current)
Swift 4.2 (3.0 tag)
Swift 4.2 (2.1 tag)
Swift 4.2 (2.0 tag)
Swift 2.3 (swift_2.3 branch)
Installation
CocoaPods
You can use CocoaPods to install DatePickerDialog by adding it to your Podfile:
To get the full benefits import DatePickerDialog wherever you import UIKit
import UIKit
import DatePickerDialog
Carthage
Create a Cartfile that lists the framework and run carthage bootstrap. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/DatePickerDialogFramework.framework to an iOS project.
github "squimer/DatePickerDialog-iOS-Swift"
Manually
Download and drop DatePickerDialog.swift in your project.
Congratulations!
Example
func datePickerTapped(){DatePickerDialog().show(title:"DatePicker", doneButtonTitle:"Done", cancelButtonTitle:"Cancel", datePickerMode:.date){ date iniflet dt = date {letformatter=DateFormatter()
formatter.dateFormat ="MM/dd/yyyy"self.textField.text = formatter.string(from: dt)}}}