瀏覽代碼

More beta SDK compatability checks

Shield more beta APIs in FLEX_AT_LEAST_IOS13_SDK
德夫 7 年之前
父節點
當前提交
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 { }