Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// GiGaBaseNavViewController.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/8/13.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface GiGaBaseNavViewController : UINavigationController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// GiGaBaseNavViewController.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/8/13.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaBaseNavViewController.h"
|
||||
|
||||
@interface GiGaBaseNavViewController ()<UINavigationControllerDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@implementation GiGaBaseNavViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
self.interactivePopGestureRecognizer.delegate = (id)self;
|
||||
self.view.backgroundColor = UIColor.whiteColor;
|
||||
}
|
||||
|
||||
-(UIStatusBarStyle)preferredStatusBarStyle
|
||||
{
|
||||
return UIStatusBarStyleDefault;
|
||||
}
|
||||
|
||||
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
|
||||
{
|
||||
if (self.viewControllers.count > 0) {
|
||||
viewController.hidesBottomBarWhenPushed = YES;
|
||||
}
|
||||
|
||||
[super pushViewController:viewController animated:animated];
|
||||
if (self.viewControllers.count > 1 ) {
|
||||
//自定义返回按钮
|
||||
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[backBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
|
||||
backBtn.backgroundColor = [UIColor redColor];
|
||||
[backBtn addTarget:self action:@selector(backItemAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
|
||||
viewController.navigationItem.leftBarButtonItem = backItem;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(void)backItemAction{
|
||||
|
||||
[super popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// GiGaBaseViewController.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/8/13.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface GiGaBaseViewController : UIViewController<UIGestureRecognizerDelegate,UINavigationControllerDelegate>
|
||||
{
|
||||
UIView *emptyView;
|
||||
}
|
||||
|
||||
//- (void)setNavigationViewWithBGColor:(UIColor *)bgColor TitleColor:(UIColor *)titleColor;
|
||||
//- (void)setNavigationViewHidden:(BOOL)hidden;
|
||||
//- (void)addBackButtonWithImageName:(NSString *)imageName;
|
||||
//- (void)setBackButtonHidden:(BOOL)hidden;
|
||||
//- (void)setNavigationViewBottomLineHidden:(BOOL)hidden;
|
||||
//
|
||||
//- (void)addRightButtonWithBGImageName:(NSString *)rightImageName action:(SEL)rightAction;
|
||||
//
|
||||
//- (void)addRefreshHeaderFooterForTableView:(UITableView *)tableView
|
||||
// refreshHeaderSelector:(SEL)refreshHeaderSelector
|
||||
// refreshFooterSelector:(SEL)refreshFooterSelector;
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// GiGaBaseViewController.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/8/13.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaBaseViewController.h"
|
||||
|
||||
@interface GiGaBaseViewController ()
|
||||
{
|
||||
// UIColor *navigationBarBGColor; //导航栏背景色
|
||||
// UIColor *navigationBarTitleColor; //导航栏标题字色
|
||||
// SEL _rightBtnAction;
|
||||
// SEL _refreshHeaderSelector;
|
||||
// SEL _refreshFooterSelector;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation GiGaBaseViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user