소스 검색

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 { }