Skip to content

Commit

Permalink
Merge pull request #1393 from novalegra/novalegra/fix-pickers
Browse files Browse the repository at this point in the history
Fix date picker appearance for carb entry in iOS 14
  • Loading branch information
ps2 authored Sep 29, 2020
2 parents 4f7139a + 60b44ad commit c283041
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Loop/View Controllers/CarbEntryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ final class CarbEntryViewController: ChartsTableViewController, IdentifiableClas
cell.titleLabel.text = NSLocalizedString("Date", comment: "Title of the carb entry date picker cell")
cell.datePicker.isEnabled = isSampleEditable
cell.datePicker.datePickerMode = .dateAndTime
#if swift(>=5.2)
if #available(iOS 14.0, *) {
cell.datePicker.preferredDatePickerStyle = .wheels
}
#endif
cell.datePicker.maximumDate = Date(timeIntervalSinceNow: maximumDateFutureInterval)
cell.datePicker.minuteInterval = 1
cell.date = date
Expand Down

1 comment on commit c283041

@biesbjerg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get this merged into AB branch too?

Please sign in to comment.