Force text color on UIDatePicker labels

This commit is contained in:
Ilya Laktyushin
2021-02-20 19:24:35 +04:00
parent 166d4add27
commit 9d3f6d34c0
11 changed files with 51 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import TelegramPresentationData
import TelegramStringFormatting
import SwiftSignalKit
import AccountContext
import UIKitRuntimeUtils
public final class DateSelectionActionSheetController: ActionSheetController {
private var presentationDisposable: Disposable?
@@ -17,7 +18,6 @@ public final class DateSelectionActionSheetController: ActionSheetController {
public init(context: AccountContext, title: String?, currentValue: Int32, minimumDate: Date? = nil, maximumDate: Date? = nil, emptyTitle: String? = nil, applyValue: @escaping (Int32?) -> Void) {
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let theme = presentationData.theme
let strings = presentationData.strings
super.init(theme: ActionSheetControllerTheme(presentationData: presentationData))
@@ -103,6 +103,8 @@ private final class DateSelectionActionSheetItemNode: ActionSheetItemNode {
self.strings = strings
self.valueChanged = valueChanged
UILabel.setDateLabel(theme.primaryTextColor)
self.pickerView = UIDatePicker()
self.pickerView.timeZone = TimeZone(secondsFromGMT: 0)
self.pickerView.datePickerMode = .countDownTimer