Skip to content

Commit

Permalink
Update demo project (#91)
Browse files Browse the repository at this point in the history
* build: migrate to a new xcode version

* feat: add safe area inset and fix navigation bar style

* build: unify code style
  • Loading branch information
Friend-LGA authored Sep 6, 2024
1 parent e0b1247 commit 096b256
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Demo/LGAlertViewDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -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)";
Expand All @@ -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)";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
4 changes: 4 additions & 0 deletions Demo/LGAlertViewDemo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#import "AppDelegate.h"
#import "TableViewController.h"
#import "LGAlertView.h"

@implementation AppDelegate

Expand All @@ -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;
}

Expand Down
9 changes: 9 additions & 0 deletions Demo/LGAlertViewDemo/NavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 096b256

Please sign in to comment.