Skip to content

Commit c283041

Browse files
authored
Merge pull request #1393 from novalegra/novalegra/fix-pickers
Fix date picker appearance for carb entry in iOS 14
2 parents 4f7139a + 60b44ad commit c283041

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Loop/View Controllers/CarbEntryViewController.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ final class CarbEntryViewController: ChartsTableViewController, IdentifiableClas
219219
cell.titleLabel.text = NSLocalizedString("Date", comment: "Title of the carb entry date picker cell")
220220
cell.datePicker.isEnabled = isSampleEditable
221221
cell.datePicker.datePickerMode = .dateAndTime
222+
#if swift(>=5.2)
223+
if #available(iOS 14.0, *) {
224+
cell.datePicker.preferredDatePickerStyle = .wheels
225+
}
226+
#endif
222227
cell.datePicker.maximumDate = Date(timeIntervalSinceNow: maximumDateFutureInterval)
223228
cell.datePicker.minuteInterval = 1
224229
cell.date = date

0 commit comments

Comments
 (0)