Skip to content

Commit

Permalink
iPhone 14适配优化
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintGao committed Dec 27, 2022
1 parent c712738 commit 4bf88a5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GKNavigationBar.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
36 changes: 36 additions & 0 deletions GKNavigationBar/NavigationBar/GKNavigationBarConfigure.m
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,42 @@ + (UIEdgeInsets)safeAreaInsetsForDeviceWithNotch {
static NSDictionary<NSString *, NSDictionary<NSNumber *, NSValue *> *> *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)],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ - (UIStatusBarStyle)preferredStatusBarStyle {
return self.gk_statusBarStyle;
}

- (void)dealloc {
NSLog(@"%@ dealloc", NSStringFromClass([self class]));
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ - (void)viewDidLoad {
[self setupUI];
}

- (void)dealloc {
NSLog(@"%@ dealloc", NSStringFromClass([self class]));
}

- (void)setupUI {
self.view.backgroundColor = [UIColor whiteColor];

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ github "QuintGao/GKNavigationBar"
<summary><font size=4>最近更新</font></summary>

```
* 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 修复侧滑返回可能出现导航栏间距不准确问题
Expand Down

0 comments on commit 4bf88a5

Please sign in to comment.