Przeglądaj źródła

More beta SDK compatability checks

Shield more beta APIs in FLEX_AT_LEAST_IOS13_SDK
德夫 7 lat temu
rodzic
commit
0de3a9d65c
1 zmienionych plików z 8 dodań i 1 usunięć
  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 { }