Explorar o código

Remove FLEX_AT_LEAST_IOS11_SDK

Also @available formatting cleanup
Tanner Bennett %!s(int64=7) %!d(string=hai) anos
pai
achega
c907a98099

+ 1 - 1
Classes/Core/FLEXTableViewController.m

@@ -115,7 +115,7 @@ CGFloat const kFLEXDebounceForExpensiveIO = 0.5;
 
 - (void)setAutomaticallyShowsSearchBarCancelButton:(BOOL)autoShowCancel {
 #if FLEX_AT_LEAST_IOS13_SDK
-    if (@available(iOS 13, *)) {
+    if (@available(iOS 13.0, *)) {
         self.searchController.automaticallyShowsCancelButton = autoShowCancel;
     } else {
         _automaticallyShowsSearchBarCancelButton = autoShowCancel;

+ 1 - 0
Classes/ExplorerInterface/FLEXExplorerViewController.h

@@ -10,6 +10,7 @@
 
 @protocol FLEXExplorerViewControllerDelegate;
 
+/// A view controller that manages the FLEX toolbar.
 @interface FLEXExplorerViewController : UIViewController
 
 @property (nonatomic, weak) id <FLEXExplorerViewControllerDelegate> delegate;

+ 28 - 31
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -93,7 +93,7 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 - (void)viewDidLoad
 {
     [super viewDidLoad];
-	
+
     // Toolbar
     self.explorerToolbar = [[FLEXExplorerToolbar alloc] init];
 
@@ -175,25 +175,25 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
 {
     [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
-         for (UIView *outlineView in [self.outlineViewsForVisibleViews allValues]) {
-             outlineView.hidden = YES;
-         }
-         self.selectedViewOverlay.hidden = YES;
-     } completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
-         for (UIView *view in self.viewsAtTapPoint) {
-             NSValue *key = [NSValue valueWithNonretainedObject:view];
-             UIView *outlineView = self.outlineViewsForVisibleViews[key];
-             outlineView.frame = [self frameInLocalCoordinatesForView:view];
-             if (self.currentMode == FLEXExplorerModeSelect) {
-                 outlineView.hidden = NO;
-             }
-         }
-
-         if (self.selectedView) {
-             self.selectedViewOverlay.frame = [self frameInLocalCoordinatesForView:self.selectedView];
-             self.selectedViewOverlay.hidden = NO;
-         }
-     }];
+        for (UIView *outlineView in [self.outlineViewsForVisibleViews allValues]) {
+            outlineView.hidden = YES;
+        }
+        self.selectedViewOverlay.hidden = YES;
+    } completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
+        for (UIView *view in self.viewsAtTapPoint) {
+            NSValue *key = [NSValue valueWithNonretainedObject:view];
+            UIView *outlineView = self.outlineViewsForVisibleViews[key];
+            outlineView.frame = [self frameInLocalCoordinatesForView:view];
+            if (self.currentMode == FLEXExplorerModeSelect) {
+                outlineView.hidden = NO;
+            }
+        }
+
+        if (self.selectedView) {
+            self.selectedViewOverlay.frame = [self frameInLocalCoordinatesForView:self.selectedView];
+            self.selectedViewOverlay.hidden = NO;
+        }
+    }];
 }
 
 #pragma mark - Setter Overrides
@@ -694,26 +694,23 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 - (CGRect)viewSafeArea
 {
     CGRect safeArea = self.view.bounds;
-#if FLEX_AT_LEAST_IOS11_SDK
-    if (@available(iOS 11, *)) {
+    if (@available(iOS 11.0, *)) {
         safeArea = UIEdgeInsetsInsetRect(self.view.bounds, self.view.safeAreaInsets);
     }
-#endif
+
     return safeArea;
 }
 
-#if FLEX_AT_LEAST_IOS11_SDK
 - (void)viewSafeAreaInsetsDidChange
 {
-  if (@available(iOS 11, *)) {
-    [super viewSafeAreaInsetsDidChange];
-  }
+    if (@available(iOS 11.0, *)) {
+        [super viewSafeAreaInsetsDidChange];
 
-  CGRect safeArea = [self viewSafeArea];
-  CGSize toolbarSize = [self.explorerToolbar sizeThatFits:CGSizeMake(CGRectGetWidth(self.view.bounds), CGRectGetHeight(safeArea))];
-  [self updateToolbarPositionWithUnconstrainedFrame:CGRectMake(CGRectGetMinX(self.explorerToolbar.frame), CGRectGetMinY(self.explorerToolbar.frame), toolbarSize.width, toolbarSize.height)];
+        CGRect safeArea = [self viewSafeArea];
+        CGSize toolbarSize = [self.explorerToolbar sizeThatFits:CGSizeMake(CGRectGetWidth(self.view.bounds), CGRectGetHeight(safeArea))];
+        [self updateToolbarPositionWithUnconstrainedFrame:CGRectMake(CGRectGetMinX(self.explorerToolbar.frame), CGRectGetMinY(self.explorerToolbar.frame), toolbarSize.width, toolbarSize.height)];
+    }
 }
-#endif
 
 
 #pragma mark - Touch Handling

+ 0 - 2
Classes/GlobalStateExplorers/DatabaseBrowser/FLEXMultiColumnTableView.m

@@ -53,11 +53,9 @@ static const CGFloat kColumnMargin = 1;
     CGFloat leftHeaderWidth = [self leftHeaderWidth];
     CGFloat topInsets = 0.f;
 
-#if FLEX_AT_LEAST_IOS11_SDK
     if (@available (iOS 11.0, *)) {
         topInsets = self.safeAreaInsets.top;
     }
-#endif
     
     CGFloat contentWidth = 0.0;
     NSInteger rowsCount = [self numberOfColumns];

+ 9 - 10
Classes/Toolbar/FLEXExplorerToolbar.m

@@ -86,7 +86,7 @@
         
         self.toolbarItems = @[_globalsItem, _hierarchyItem, _selectItem, _moveItem, _closeItem];
     }
-        
+
     return self;
 }
 
@@ -161,8 +161,8 @@
     descriptionLabelFrame.size.width = CGRectGetMaxX(self.selectedViewDescriptionContainer.bounds) - kHorizontalPadding - descriptionOriginX;
     self.selectedViewDescriptionLabel.frame = descriptionLabelFrame;
 }
-    
-    
+
+
 #pragma mark - Setter Overrides
 
 - (void)setToolbarItems:(NSArray<FLEXToolbarItem *> *)toolbarItems {
@@ -262,13 +262,12 @@
 
 - (CGRect)safeArea
 {
-  CGRect safeArea = self.bounds;
-#if FLEX_AT_LEAST_IOS11_SDK
-  if (@available(iOS 11, *)) {
-    safeArea = UIEdgeInsetsInsetRect(self.bounds, self.safeAreaInsets);
-  }
-#endif
-  return safeArea;
+    CGRect safeArea = self.bounds;
+    if (@available(iOS 11.0, *)) {
+        safeArea = UIEdgeInsetsInsetRect(self.bounds, self.safeAreaInsets);
+    }
+
+    return safeArea;
 }
 
 @end

+ 2 - 2
Classes/Utility/FLEXColor.m

@@ -12,7 +12,7 @@
 #if FLEX_AT_LEAST_IOS13_SDK
 #define FLEXDynamicColor(dynamic, static) ({ \
     UIColor *c; \
-    if (@available(iOS 13, *)) { \
+    if (@available(iOS 13.0, *)) { \
         c = [UIColor dynamic]; \
     } else { \
         c = [UIColor static]; \
@@ -71,7 +71,7 @@
 
 + (UIColor *)tintColor {
     #if FLEX_AT_LEAST_IOS13_SDK
-    if (@available(iOS 13, *)) {
+    if (@available(iOS 13.0, *)) {
         return [UIColor systemBlueColor];
     } else {
         return [UIApplication sharedApplication].keyWindow.tintColor;

+ 0 - 2
Classes/Utility/FLEXKeyboardShortcutManager.m

@@ -165,14 +165,12 @@
                     pressureLevel++;
                 }
                 if (pressureLevel > 0) {
-#if FLEX_AT_LEAST_IOS11_SDK
                     if (@available(iOS 9.0, *)) {
                         for (UITouch *touch in [event allTouches]) {
                             double adjustedPressureLevel = pressureLevel * 20 * touch.maximumPossibleForce;
                             [touch setValue:@(adjustedPressureLevel) forKey:@"_pressure"];
                         }
                     }
-#endif
                 }
             }
             

+ 0 - 6
Classes/Utility/FLEXUtility.h

@@ -14,12 +14,6 @@
 
 #define FLEXFloor(x) (floor([[UIScreen mainScreen] scale] * (x)) / [[UIScreen mainScreen] scale])
 
-#if defined(__IPHONE_11_0)
-#define FLEX_AT_LEAST_IOS11_SDK (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0)
-#else
-#define FLEX_AT_LEAST_IOS11_SDK NO
-#endif
-
 #if defined(__IPHONE_13_0)
 #define FLEX_AT_LEAST_IOS13_SDK (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0)
 #else

+ 2 - 3
Example/UICatalog.xcodeproj/project.pbxproj

@@ -366,7 +366,6 @@
 				ORGANIZATIONNAME = f;
 				TargetAttributes = {
 					5356823918F3656900BAAD62 = {
-						DevelopmentTeam = 7JHAJ3JSPW;
 						ProvisioningStyle = Automatic;
 					};
 				};
@@ -585,7 +584,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = 7JHAJ3JSPW;
+				DEVELOPMENT_TEAM = "";
 				EXCLUDED_SOURCE_FILE_NAMES = "";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -608,7 +607,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				DEVELOPMENT_TEAM = 7JHAJ3JSPW;
+				DEVELOPMENT_TEAM = "";
 				EXCLUDED_SOURCE_FILE_NAMES = "FLEX*";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",