title: Property 'preferredDatePickerStyle' not found on object of type 'UIDatePicker'
body: <p>I am using react-native 0.62.2 version and datetimepicker version 3.0.1. As I am trying to build the project with xcode, the following errors are being shown:</p>
  <ol>
  <li>Use of undeclared identifier 'UIDatePickerStyleCompact'</li>
  <li>Use of undeclared identifier 'UIDatePickerStyleWheels'</li>
  <li>Property 'preferredDatePickerStyle' not found on object of type
  'RNDateTimePicker *'</li>
  <li>Property 'preferredDatePickerStyle' not found on object of type
  'UIDatePicker*'</li>
  <li>Implicit conversion of 'NSInteger' (aka 'long') to 'id' is
  disallowed with ARC</li>
  <li>Statement requires expression of integer type ('__strong id'
  invalid)</li>
  <li>Implicit conversion of 'UIDatePickerMode' (aka 'enum
  UIDatePickerMode') to 'id' is disallowed with ARC</li>
  <li>Use of undeclared identifier 'UIDatePickerStyleWheels'</li>
  </ol>
  <p>The following is the code inside <strong>RNDateTimePickerManager.h</strong></p>
  <pre><code>#import &quot;RNDateTimePickerManager.h&quot;
  
  #import &lt;React/RCTBridge.h&gt;
  #import &lt;React/RCTEventDispatcher.h&gt;
  #import &quot;RNDateTimePicker.h&quot;
  #import &lt;React/UIView+React.h&gt;
  
  @implementation RCTConvert(UIDatePicker)
  
  RCT_ENUM_CONVERTER(UIDatePickerMode, (@{
    @&quot;time&quot;: @(UIDatePickerModeTime),
    @&quot;date&quot;: @(UIDatePickerModeDate),
    @&quot;datetime&quot;: @(UIDatePickerModeDateAndTime),
  }), UIDatePickerModeTime, integerValue)
  
  RCT_ENUM_CONVERTER(UIDatePickerStyle, (@{                //Error 5
      @&quot;default&quot;: @(UIActionSheetStyleAutomatic),
      @&quot;compact&quot;: @(UIDatePickerStyleCompact),             //Error 1
      @&quot;spinner&quot;: @(UIDatePickerStyleWheels),              //Error 2
  #if __IPHONE_OS_VERSION_MAX_ALLOWED &gt;= 140000
      @&quot;inline&quot;: @(UIDatePickerStyleInline),
  #endif
  }), UIActionSheetStyleAutomatic, integerValue)
  
  @end
  
  @implementation RNDateTimePickerManager
  
  RCT_EXPORT_MODULE()
  
  - (UIView *)view
  {
    return [RNDateTimePicker new];
  }
  
  + (NSString*) datepickerStyleToString: (UIDatePickerStyle) style {
      // RCTConvert does not handle this.?
      switch (style) {                                       //Error 6
          case UIDatePickerStyleCompact:
              return @&quot;compact&quot;;
          case UIDatePickerStyleWheels:
              return @&quot;spinner&quot;;
  #if __IPHONE_OS_VERSION_MAX_ALLOWED &gt;= 140000
          case UIDatePickerStyleInline:
              return @&quot;inline&quot;;
  #endif
          default:
              [NSException raise:@&quot;Unsupported style value&quot; format:@&quot;UIDatePickerStyle of %ld is unsupported&quot;, (long)style];
              return @&quot;&quot;;
      }
  }
  
  RCT_EXPORT_METHOD(getDefaultDisplayValue:(NSDictionary *)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
  {
      dispatch_async(dispatch_get_main_queue(), ^{
          UIDatePicker* view = [RNDateTimePicker new];
          
          view.preferredDatePickerStyle = UIActionSheetStyleAutomatic;          //Error 4
          UIDatePickerMode renderedMode = [RCTConvert UIDatePickerMode:options[@&quot;mode&quot;]];
          view.datePickerMode = renderedMode;
          // NOTE afaict we do not need to measure the actual dimensions here, but if we do, just look at the original PR
          
          UIDatePickerMode determinedDisplayValue = view.datePickerMode;    //Error 7
  
          resolve(@{
                   @&quot;determinedDisplayValue&quot;: [RNDateTimePickerManager datepickerStyleToString:determinedDisplayValue],
                  });
      });
  }
  
  RCT_EXPORT_VIEW_PROPERTY(date, NSDate)
  RCT_EXPORT_VIEW_PROPERTY(locale, NSLocale)
  RCT_EXPORT_VIEW_PROPERTY(minimumDate, NSDate)
  RCT_EXPORT_VIEW_PROPERTY(maximumDate, NSDate)
  RCT_EXPORT_VIEW_PROPERTY(minuteInterval, NSInteger)
  RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)
  RCT_REMAP_VIEW_PROPERTY(mode, datePickerMode, UIDatePickerMode)
  RCT_REMAP_VIEW_PROPERTY(timeZoneOffsetInMinutes, timeZone, NSTimeZone)
  
  RCT_CUSTOM_VIEW_PROPERTY(textColor, UIColor, RNDateTimePicker)
  {
      if (@available(iOS 14.0, *) &amp;&amp; view.datePickerMode != UIDatePickerStyleWheels) {  //Error 8
      // prevents #247
      return;
    }
    if (json) {
      [view setValue:[RCTConvert UIColor:json] forKey:@&quot;textColor&quot;];
      [view setValue:@(NO) forKey:@&quot;highlightsToday&quot;];
    } else {
      UIColor* defaultColor;
      if (@available(iOS 13.0, *)) {
          defaultColor = [UIColor labelColor];
      } else {
          defaultColor = [UIColor blackColor];
      }
      [view setValue:defaultColor forKey:@&quot;textColor&quot;];
      [view setValue:@(YES) forKey:@&quot;highlightsToday&quot;];
    }
  }
  
  // TODO vonovak setting preferredDatePickerStyle invalidates minuteinterval
  RCT_CUSTOM_VIEW_PROPERTY(displayIOS, UIDatePickerStyle, RNDateTimePicker)
  {
      if (@available(iOS 13.4, *)) {
          if (json) {
              UIDatePickerMode propValue = [RCTConvert UIDatePickerStyle:json];
              view.preferredDatePickerStyle = propValue;           //Error 3
          } else {
              view.preferredDatePickerStyle = UIActionSheetStyleAutomatic;
          }
      }
  }
  
  @end
  </code></pre>
  <p>Is there any bug in the react-native datetimepicker?</p>