Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiling on Linux #696

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Classes/Core/Controllers/FLEXNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#import "FLEXObjectExplorerFactory.h"
#import "FLEXTabList.h"

// https://stackoverflow.com/a/5337804
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

@interface UINavigationController (Private) <UIGestureRecognizerDelegate>
- (void)_gestureRecognizedInteractiveHide:(UIGestureRecognizer *)sender;
@end
Expand Down Expand Up @@ -48,7 +51,7 @@ - (void)viewDidLoad {
[self.navigationBar addGestureRecognizer:navbarTapGesture];

// Add gesture to dismiss if not presented with a sheet style
if (@available(iOS 13, *)) {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0")) {
switch (self.modalPresentationStyle) {
case UIModalPresentationAutomatic:
case UIModalPresentationPageSheet:
Expand All @@ -67,7 +70,7 @@ - (void)viewDidLoad {
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

if (@available(iOS 15.0, *)) {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"15.0")) {
UISheetPresentationController *presenter = self.sheetPresentationController;
presenter.detents = @[
UISheetPresentationControllerDetent.mediumDetent,
Expand Down
15 changes: 9 additions & 6 deletions Classes/ExplorerInterface/FLEXExplorerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
FLEXExplorerModeMove
};

// https://stackoverflow.com/a/5337804
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

@interface FLEXExplorerViewController () <FLEXHierarchyDelegate, UIAdaptivePresentationControllerDelegate>

/// Tracks the currently active tool/mode
Expand Down Expand Up @@ -126,7 +129,7 @@ - (void)viewDidLoad {
[self.view addGestureRecognizer:self.movePanGR];

// Feedback
if (@available(iOS 10.0, *)) {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) {
_selectionFBG = [UISelectionFeedbackGenerator new];
}

Expand Down Expand Up @@ -429,7 +432,7 @@ - (void)hierarchyButtonTapped:(FLEXExplorerToolbarItem *)sender {
}

- (UIWindow *)statusWindow {
if (!@available(iOS 16, *)) {
if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"16.0")) {
NSString *statusBarString = [NSString stringWithFormat:@"%@arWindow", @"_statusB"];
return [UIApplication.sharedApplication valueForKey:statusBarString];
}
Expand Down Expand Up @@ -684,7 +687,7 @@ - (void)handleChangeViewAtPointGesture:(UIPanGestureRecognizer *)sender {
}

- (void)actuateSelectionChangedFeedback {
if (@available(iOS 10.0, *)) {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) {
[self.selectionFBG selectionChanged];
}
}
Expand Down Expand Up @@ -824,15 +827,15 @@ - (void)updateSelectedViewPositionWithDragGesture:(UIPanGestureRecognizer *)move

- (CGRect)viewSafeArea {
CGRect safeArea = self.view.bounds;
if (@available(iOS 11.0, *)) {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
safeArea = UIEdgeInsetsInsetRect(self.view.bounds, self.view.safeAreaInsets);
}

return safeArea;
}

- (void)viewSafeAreaInsetsDidChange {
if (@available(iOS 11.0, *)) {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
[super viewSafeAreaInsetsDidChange];

CGRect safeArea = [self viewSafeArea];
Expand Down Expand Up @@ -916,7 +919,7 @@ - (void)presentViewController:(UIViewController *)toPresent
[self.view.window makeKeyWindow];

// Move the status bar on top of FLEX so we can get scroll to top behavior for taps.
if (!@available(iOS 13, *)) {
if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0")) {
[self statusWindow].windowLevel = self.view.window.windowLevel + 1.0;
}

Expand Down