Skip to content

Commit

Permalink
修复bug #93,发布1.6.5版本
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintGao committed Jan 20, 2022
1 parent 6deb86d commit 6b89489
Show file tree
Hide file tree
Showing 60 changed files with 2,108 additions and 764 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.6.4'
s.version = '1.6.5'
s.license = 'MIT'
s.summary = '自定义导航栏--导航栏联动'
s.homepage = 'https://github.com/QuintGao/GKNavigationBar'
Expand Down
1 change: 1 addition & 0 deletions GKNavigationBar/NavigationBar/GKNavigationBarConfigure.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSArray *shiledItemSpaceVCs;

/// 导航栏左右间距,内部使用
@property (nonatomic, assign, readonly) BOOL disableFixSpace;
@property (nonatomic, assign, readonly) CGFloat navItemLeftSpace;
@property (nonatomic, assign, readonly) CGFloat navItemRightSpace;

Expand Down
5 changes: 4 additions & 1 deletion GKNavigationBar/NavigationBar/GKNavigationBarConfigure.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

@interface GKNavigationBarConfigure()

@property (nonatomic, assign) BOOL disableFixSpace;
@property (nonatomic, assign) CGFloat navItemLeftSpace;
@property (nonatomic, assign) CGFloat navItemRightSpace;

Expand All @@ -44,6 +45,7 @@ - (void)setupDefaultConfigure {
self.blackBackImage = [UIImage gk_imageNamed:@"btn_back_black"];
self.whiteBackImage = [UIImage gk_imageNamed:@"btn_back_white"];
self.backStyle = GKNavigationBarBackStyleBlack;
self.disableFixSpace = NO;
self.gk_disableFixSpace = NO;
self.gk_navItemLeftSpace = 0;
self.gk_navItemRightSpace = 0;
Expand All @@ -59,6 +61,7 @@ - (void)setupCustomConfigure:(void (^)(GKNavigationBarConfigure * _Nonnull))bloc

!block ? : block(self);

self.disableFixSpace = self.gk_disableFixSpace;
self.navItemLeftSpace = self.gk_navItemLeftSpace;
self.navItemRightSpace = self.gk_navItemRightSpace;
}
Expand All @@ -69,7 +72,7 @@ - (void)updateConfigure:(void (^)(GKNavigationBarConfigure * _Nonnull))block {

- (UIViewController *)visibleViewController {
return [[GKNavigationBarConfigure keyWindow].rootViewController gk_findCurrentViewControllerIsRoot:YES];
}
}

- (CGFloat)gk_fixedSpace {
// 经测试发现iPhone 12和iPhone 12 Pro,默认导航栏间距是16,需要单独处理
Expand Down
11 changes: 11 additions & 0 deletions GKNavigationBar/NavigationBar/UIViewController+GKNavigationBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ - (void)gk_viewDidAppear:(BOOL)animated {
}else {
[self restoreSystemNavBar];
}

if (self.gk_disableFixNavItemSpace) {
[GKConfigure updateConfigure:^(GKNavigationBarConfigure * _Nonnull configure) {
configure.gk_disableFixSpace = YES;
}];
}else {
[GKConfigure updateConfigure:^(GKNavigationBarConfigure * _Nonnull configure) {
configure.gk_disableFixSpace = configure.disableFixSpace;
}];
}

[self gk_viewDidAppear:animated];
}

Expand Down
7 changes: 2 additions & 5 deletions GKNavigationBarExample/GKNavigationBarExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,18 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// 导航栏返回按钮样式
configure.backStyle = GKNavigationBarBackStyleBlack;
// 导航栏左右item间距
configure.gk_navItemLeftSpace = 10.0f;
configure.gk_navItemLeftSpace = 0.0f;
configure.gk_navItemRightSpace = 10.0f;

configure.gk_restoreSystemNavBar = YES;

// configure.shiledItemSpaceVCs = @[NSClassFromString(@"TZPhotoPickerController"), @"TZAlbumPickerController", @"TZ"];
configure.shiledItemSpaceVCs = @[@"UIActivityViewController", @"UIActivityContentViewController"];
configure.shiledItemSpaceVCs = @[NSClassFromString(@"TZPhotoPickerController"), @"TZAlbumPickerController", @"TZ"];
}];

[GKGestureConfigure setupCustomConfigure:^(GKGestureHandleConfigure * _Nonnull configure) {
configure.gk_translationX = 15;
configure.gk_translationY = 20;
configure.gk_scaleX = 0.90;
configure.gk_scaleY = 0.92;
configure.shiledGuestureVCs = @[NSClassFromString(@"TZPhotoPickerController"), @"TZAlbumPickerController", @"TZ"];
configure.gk_openScrollViewGestureHandle = YES;
}];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ - (void)viewDidLoad {

self.navigationItem.title = @"系统导航";

self.gk_navItemRightSpace = 20.0f;
self.gk_disableFixNavItemSpace = YES;
self.gk_navItemRightSpace = 40.0f;
UIBarButtonItem *rightItem = [UIBarButtonItem gk_itemWithTitle:@"push" target:self action:@selector(click)];
rightItem.customView.backgroundColor = [UIColor blackColor];
self.navigationItem.rightBarButtonItem = rightItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ - (void)viewDidLoad {
self.gk_statusBarStyle = UIStatusBarStyleLightContent;
self.gk_navTitleFont = [UIFont systemFontOfSize:18.0f];
self.gk_navTitleColor = UIColor.whiteColor;
// self.gk_navRightBarButtonItem = [UIBarButtonItem gk_itemWithTitle:@"你好" target:self action:@selector(backItemClick:)];
// self.gk_navRightBarButtonItem.customView.backgroundColor = UIColor.redColor;

[self setupTableView];
}
Expand All @@ -67,6 +69,11 @@ - (void)viewWillAppear:(BOOL)animated {
[self.tableView reloadData];
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];

}

- (void)setupTableView {

self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
Expand Down
18 changes: 9 additions & 9 deletions GKNavigationBarExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- GKNavigationBar (1.5.7):
- GKNavigationBar/GestureHandle (= 1.5.7)
- GKNavigationBar/NavigationBar (= 1.5.7)
- GKNavigationBar/GestureHandle (1.5.7)
- GKNavigationBar/NavigationBar (1.5.7)
- GKNavigationBar (1.6.5):
- GKNavigationBar/GestureHandle (= 1.6.5)
- GKNavigationBar/NavigationBar (= 1.6.5)
- GKNavigationBar/GestureHandle (1.6.5)
- GKNavigationBar/NavigationBar (1.6.5)
- Masonry (1.1.0)
- TZImagePickerController (3.5.4)
- TZImagePickerController (3.7.2)

DEPENDENCIES:
- GKNavigationBar (from `../`)
Expand All @@ -22,10 +22,10 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
GKNavigationBar: a09106dc614e6a458d5c64048e7945a47a266fb8
GKNavigationBar: 6ff26aab2246e9f258aef2a02735dc823be314f8
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
TZImagePickerController: 891421e1fa0d8dfa295388e1f8a8ce2d5152ae88
TZImagePickerController: 0f926234c46362d3c4ed128832b6da59b2d9917e

PODFILE CHECKSUM: 95fda486a7cfa7f6da3af0b1d5950da0b15791fd

COCOAPODS: 1.10.1
COCOAPODS: 1.11.2

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions GKNavigationBarExample/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6b89489

Please sign in to comment.