From b8048c099c8c46f3e9fc4c55b8d56e6123686aa2 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Tue, 18 Aug 2020 19:53:15 +0200 Subject: [PATCH] fix: prevent unrecognized selector setHighlightsToday on iOS 14 (#249) * fix: prevent unrecognized selector setHighlightsToday on iOS 14 * improve docs --- CHANGELOG.md | 4 ++++ README.md | 2 +- ios/RNDateTimePickerManager.m | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb2690a..b088ba47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +### Changelog is no longer maintained + +Please see the [releases page](https://github.com/react-native-community/datetimepicker/releases) + ### 2.6.0 - Add time picker for Windows [#206](https://github.com/react-native-community/datetimepicker/pull/206) diff --git a/README.md b/README.md index 2b7114ee..ec731e04 100644 --- a/README.md +++ b/README.md @@ -297,7 +297,7 @@ Indicates which day is shown as the first day of the week. #### `textColor` (`optional`, `iOS only`) -Allows changing of the textColor of the date picker. +Allows changing of the textColor of the date picker. Has effect only when `display` is `"spinner"`. ```js diff --git a/ios/RNDateTimePickerManager.m b/ios/RNDateTimePickerManager.m index e451ecaa..d48de304 100644 --- a/ios/RNDateTimePickerManager.m +++ b/ios/RNDateTimePickerManager.m @@ -86,6 +86,10 @@ + (NSString*) datepickerStyleToString: (UIDatePickerStyle) style { RCT_CUSTOM_VIEW_PROPERTY(textColor, UIColor, RNDateTimePicker) { + if (@available(iOS 14.0, *) && view.datePickerStyle != UIDatePickerStyleWheels) { + // prevents #247 + return; + } if (json) { [view setValue:[RCTConvert UIColor:json] forKey:@"textColor"]; [view setValue:@(NO) forKey:@"highlightsToday"];