Просмотр исходного кода

More beta SDK compatability checks

Shield more beta APIs in FLEX_AT_LEAST_IOS13_SDK
德夫 лет назад: 7
Родитель
Сommit
0de3a9d65c
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      Classes/Core/FLEXTableViewController.m

+ 8 - 1
Classes/Core/FLEXTableViewController.m

@@ -26,12 +26,15 @@ CGFloat const kFLEXDebounceForExpensiveIO = 0.5;
 #pragma mark - Public
 
 - (id)init {
+#if FLEX_AT_LEAST_IOS13_SDK
     if (@available(iOS 13.0, *)) {
         self = [self initWithStyle:UITableViewStyleInsetGrouped];
     } else {
         self = [self initWithStyle:UITableViewStyleGrouped];
     }
-    
+#else
+    self = [self initWithStyle:UITableViewStyleGrouped];
+#endif
     return self;
 }
 
@@ -73,11 +76,15 @@ CGFloat const kFLEXDebounceForExpensiveIO = 0.5;
 }
 
 - (void)setAutomaticallyShowsSearchBarCancelButton:(BOOL)autoShowCancel {
+#if FLEX_AT_LEAST_IOS13_SDK
     if (@available(iOS 13, *)) {
         self.searchController.automaticallyShowsCancelButton = autoShowCancel;
     } else {
         _automaticallyShowsSearchBarCancelButton = autoShowCancel;
     }
+#else
+    _automaticallyShowsSearchBarCancelButton = autoShowCancel;
+#endif
 }
 
 - (void)updateSearchResults:(NSString *)newText { }