Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ - (CGFloat)getDatePickerHeight
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 // Xcode 12 and iOS 14, or greater
if (@available(iOS 14.0, *)) {
if (_datePickerStyle == UIDatePickerStyleCompact) {
height = 90.0;
height = 250.0;
} else if (_datePickerStyle == UIDatePickerStyleInline) {
switch (_datePickerMode) {
case UIDatePickerModeDate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class SWTableViewController: UITableViewController, UITextFieldDelegate {

@IBAction func datePickerClicked(_ sender: UIButton) {
// example of date picker with min and max values set (as a week in past and week in future from today)
let datePicker = ActionSheetDatePicker(title: "Date within 2 weeks - (Inline):",
let datePicker = ActionSheetDatePicker(title: "Date within 2 weeks - (Compact):",
datePickerMode: UIDatePicker.Mode.date,
selectedDate: Date(),
doneBlock: { picker, date, origin in
Expand All @@ -86,7 +86,7 @@ class SWTableViewController: UITableViewController, UITextFieldDelegate {
datePicker?.minimumDate = Date(timeInterval: -secondsInWeek, since: Date())
datePicker?.maximumDate = Date(timeInterval: secondsInWeek, since: Date())
if #available(iOS 14.0, *) {
datePicker?.datePickerStyle = .inline
datePicker?.datePickerStyle = .compact
}

datePicker?.show()
Expand Down