83 lines
1.4 KiB
Objective-C
83 lines
1.4 KiB
Objective-C
//
|
|
// BaseViewController.m
|
|
// xplan-ios
|
|
//
|
|
// Created by zu on 2021/8/31.
|
|
//
|
|
|
|
#import "BaseViewController.h"
|
|
///Tool
|
|
#import "XCHUDTool.h"
|
|
#import "ThemeColor.h"
|
|
|
|
@interface BaseViewController ()
|
|
|
|
@end
|
|
|
|
@implementation BaseViewController
|
|
|
|
- (void)viewWillAppear:(BOOL)animated{
|
|
[super viewWillAppear:animated];
|
|
// 根据子类属性重写判断是否隐藏导航栏
|
|
[self.navigationController setNavigationBarHidden:self.isHiddenNavBar animated:animated];
|
|
}
|
|
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
[self themeConfig];
|
|
}
|
|
|
|
- (void)themeConfig {
|
|
self.view.backgroundColor = [ThemeColor appBackgroundColor];
|
|
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
|
|
}
|
|
|
|
/**
|
|
隐藏导航条
|
|
*/
|
|
- (void)hideNavigationBar {
|
|
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
|
}
|
|
|
|
|
|
/**
|
|
显示导航条
|
|
*/
|
|
- (void)showNavigationBar {
|
|
[self.navigationController setNavigationBarHidden:NO];
|
|
}
|
|
|
|
/**
|
|
显示状态栏
|
|
*/
|
|
- (void)showStatusBar {
|
|
[UIApplication sharedApplication].statusBarHidden = NO;
|
|
}
|
|
|
|
/**
|
|
隐藏状态栏
|
|
*/
|
|
- (void)hideStatusBar {
|
|
[UIApplication sharedApplication].statusBarHidden = YES;
|
|
}
|
|
|
|
- (void)showSuccessToast:(NSString *)msg {
|
|
[XCHUDTool showSuccessWithMessage:msg];
|
|
}
|
|
|
|
- (void)showErrorToast:(NSString *)msg {
|
|
[XCHUDTool showErrorWithMessage:msg];
|
|
}
|
|
|
|
- (void)showLoading {
|
|
[XCHUDTool showLoading];
|
|
}
|
|
|
|
- (void)hideHUD {
|
|
[XCHUDTool hideHUD];
|
|
}
|
|
|
|
|
|
@end
|