From 096b256d4f0a51c0a6c9e8f7792b455cc197e26a Mon Sep 17 00:00:00 2001 From: Grigorii Lutkov Date: Sat, 7 Sep 2024 00:16:59 +0300 Subject: [PATCH] Update demo project (#91) * build: migrate to a new xcode version * feat: add safe area inset and fix navigation bar style * build: unify code style --- Demo/LGAlertViewDemo.xcodeproj/project.pbxproj | 5 +++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ Demo/LGAlertViewDemo/AppDelegate.m | 4 ++++ Demo/LGAlertViewDemo/NavigationController.m | 9 +++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Demo/LGAlertViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Demo/LGAlertViewDemo.xcodeproj/project.pbxproj b/Demo/LGAlertViewDemo.xcodeproj/project.pbxproj index b3052fd..dde534e 100644 --- a/Demo/LGAlertViewDemo.xcodeproj/project.pbxproj +++ b/Demo/LGAlertViewDemo.xcodeproj/project.pbxproj @@ -232,6 +232,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -382,7 +383,7 @@ buildSettings = { DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = LGAlertViewDemo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.test.LGAlertViewDemo; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -395,7 +396,7 @@ buildSettings = { DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = LGAlertViewDemo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.test.LGAlertViewDemo; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Demo/LGAlertViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Demo/LGAlertViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Demo/LGAlertViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Demo/LGAlertViewDemo/AppDelegate.m b/Demo/LGAlertViewDemo/AppDelegate.m index 95900d5..bceb1e4 100644 --- a/Demo/LGAlertViewDemo/AppDelegate.m +++ b/Demo/LGAlertViewDemo/AppDelegate.m @@ -5,6 +5,7 @@ #import "AppDelegate.h" #import "TableViewController.h" +#import "LGAlertView.h" @implementation AppDelegate @@ -17,6 +18,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; + // Set default action sheet offset equal to safe area of the screen + [[LGAlertView appearance] setCancelButtonOffsetY: UIApplication.sharedApplication.windows.firstObject.safeAreaInsets.bottom]; + return YES; } diff --git a/Demo/LGAlertViewDemo/NavigationController.m b/Demo/LGAlertViewDemo/NavigationController.m index 6ad44ed..4f06037 100644 --- a/Demo/LGAlertViewDemo/NavigationController.m +++ b/Demo/LGAlertViewDemo/NavigationController.m @@ -14,6 +14,15 @@ - (void)viewDidLoad { self.navigationBar.barTintColor = [UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0]; self.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]}; self.navigationBar.tintColor = [UIColor colorWithWhite:1.0 alpha:0.5]; + + if (@available(iOS 13.0, *)) { + UINavigationBarAppearance *standardAppearance = [UINavigationBarAppearance new]; + standardAppearance.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]}; + standardAppearance.backgroundColor = [UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0]; + self.navigationBar.standardAppearance = standardAppearance; + self.navigationBar.scrollEdgeAppearance = standardAppearance; + self.navigationBar.compactAppearance = standardAppearance; + } } - (BOOL)shouldAutorotate {