Skip to content

Commit b8048c0

Browse files
authored
fix: prevent unrecognized selector setHighlightsToday on iOS 14 (#249)
* fix: prevent unrecognized selector setHighlightsToday on iOS 14 * improve docs
1 parent a809783 commit b8048c0

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
### Changelog is no longer maintained
4+
5+
Please see the [releases page](https://github.com/react-native-community/datetimepicker/releases)
6+
37
### 2.6.0
48

59
- Add time picker for Windows [#206](https://github.com/react-native-community/datetimepicker/pull/206)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Indicates which day is shown as the first day of the week.
297297

298298
#### `textColor` (`optional`, `iOS only`)
299299

300-
Allows changing of the textColor of the date picker.
300+
Allows changing of the textColor of the date picker. Has effect only when `display` is `"spinner"`.
301301

302302
```js
303303
<RNDateTimePicker textColor="red" />

ios/RNDateTimePickerManager.m

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ + (NSString*) datepickerStyleToString: (UIDatePickerStyle) style {
8686

8787
RCT_CUSTOM_VIEW_PROPERTY(textColor, UIColor, RNDateTimePicker)
8888
{
89+
if (@available(iOS 14.0, *) && view.datePickerStyle != UIDatePickerStyleWheels) {
90+
// prevents #247
91+
return;
92+
}
8993
if (json) {
9094
[view setValue:[RCTConvert UIColor:json] forKey:@"textColor"];
9195
[view setValue:@(NO) forKey:@"highlightsToday"];

0 commit comments

Comments
 (0)