From 4bf88a5d74d90f8f47a614284fe5852a191d7bbc Mon Sep 17 00:00:00 2001 From: QuintGao <13514024+QuintGao@users.noreply.github.com> Date: Tue, 27 Dec 2022 14:21:32 +0800 Subject: [PATCH] =?UTF-8?q?iPhone=2014=E9=80=82=E9=85=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GKNavigationBar.podspec | 2 +- .../NavigationBar/GKNavigationBarConfigure.m | 36 +++++++++++++++++++ .../Demo/BaseVC/GKBaseViewController.m | 4 +++ .../Demo/BaseVC/GKDemoBaseViewController.m | 4 --- README.md | 1 + 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/GKNavigationBar.podspec b/GKNavigationBar.podspec index 3171098..7627cf6 100644 --- a/GKNavigationBar.podspec +++ b/GKNavigationBar.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GKNavigationBar' - s.version = '1.8.1' + s.version = '1.8.2' s.license = 'MIT' s.summary = '自定义导航栏--导航栏联动' s.homepage = 'https://github.com/QuintGao/GKNavigationBar' diff --git a/GKNavigationBar/NavigationBar/GKNavigationBarConfigure.m b/GKNavigationBar/NavigationBar/GKNavigationBarConfigure.m index 81d49c0..32348d0 100644 --- a/GKNavigationBar/NavigationBar/GKNavigationBarConfigure.m +++ b/GKNavigationBar/NavigationBar/GKNavigationBarConfigure.m @@ -512,6 +512,42 @@ + (UIEdgeInsets)safeAreaInsetsForDeviceWithNotch { static NSDictionary *> *dict; if (!dict) { dict = @{ + // iPhone 14 + @"iPhone14,7": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(47, 0, 34, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 47, 21, 47)], + }, + @"iPhone14,7-Zoom": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(48, 0, 28, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 48, 21, 48)], + }, + // iPhone 14 Plus + @"iPhone14,8": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(47, 0, 34, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 47, 21, 47)], + }, + @"iPhone14,8-Zoom": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(41, 0, 30, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 41, 21, 41)], + }, + // iPhone 14 Pro + @"iPhone15,2": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(59, 0, 34, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 59, 21, 59)], + }, + @"iPhone15,2-Zoom": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(48, 0, 28, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 48, 21, 48)], + }, + // iPhone 14 Pro Max + @"iPhone15,3": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(59, 0, 34, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 59, 21, 59)], + }, + @"iPhone15,3-Zoom": @{ + @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(51, 0, 31, 0)], + @(UIInterfaceOrientationLandscapeLeft): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, 51, 21, 51)], + }, // iPhone 13 mini @"iPhone14,4": @{ @(UIInterfaceOrientationPortrait): [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(50, 0, 34, 0)], diff --git a/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKBaseViewController.m b/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKBaseViewController.m index 371560a..b7684e9 100644 --- a/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKBaseViewController.m +++ b/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKBaseViewController.m @@ -28,4 +28,8 @@ - (UIStatusBarStyle)preferredStatusBarStyle { return self.gk_statusBarStyle; } +- (void)dealloc { + NSLog(@"%@ dealloc", NSStringFromClass([self class])); +} + @end diff --git a/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKDemoBaseViewController.m b/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKDemoBaseViewController.m index f56cffe..3b745a2 100644 --- a/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKDemoBaseViewController.m +++ b/GKNavigationBarExample/GKNavigationBarExample/Demo/BaseVC/GKDemoBaseViewController.m @@ -30,10 +30,6 @@ - (void)viewDidLoad { [self setupUI]; } -- (void)dealloc { - NSLog(@"%@ dealloc", NSStringFromClass([self class])); -} - - (void)setupUI { self.view.backgroundColor = [UIColor whiteColor]; diff --git a/README.md b/README.md index 2141dbd..577cd25 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ github "QuintGao/GKNavigationBar" 最近更新 ``` +* 1.8.2 - 2022.12.27 iPhone 14适配优化 * 1.8.1 - 2022.09.29 移除导航栏上的点击事件 * 1.8.0 - 2022.09.16 导航栏高度适配iPhone 14系列新设备 * 1.7.9 - 2022.08.18 修复侧滑返回可能出现导航栏间距不准确问题