Files
yinmeng-ios/xplan-ios/Base/UI/BaseViewController.h
2022-10-09 16:36:26 +08:00

102 lines
1.9 KiB
Objective-C

//
// BaseViewController.h
// xplan-ios
//
// Created by zu on 2021/8/31.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol BaseViewControllerProtocol <NSObject>
/**
成功 toast
*/
- (void)showSuccessToast:(NSString *)msg;
/**
失败 toast
*/
- (void)showErrorToast:(NSString *)msg;
/**
加载 loading
*/
- (void)showLoading;
/**
隐藏 XCHUDTool
*/
- (void)hideHUD;
/**
显示加载个播房loading
*/
- (void)showAnchorLoading;
@end
@interface BaseViewController : UIViewController<BaseViewControllerProtocol>
// 是否隐藏导航 默认是不隐藏的
@property(nonatomic,assign,getter=isHiddenNavBar) BOOL hiddenNavBar;
///是否青少年模式
@property (nonatomic, assign) BOOL parentMode;
/**
显示/隐藏导航
*/
- (void)hideNavigationBar;
/**
隐藏导航栏
*/
- (void)showNavigationBar;
/**
显示/隐藏状态栏
*/
- (void)showStatusBar;
/**
隐藏状态栏
*/
- (void)hideStatusBar;
#pragma mark - 导航栏添加操作按钮
/// 添加图片
/// @param imageNames 图片的数组
/// @param isLeft 是否在左边
/// @param target 接受事件的
/// @param action 点击
/// @param tags tag
- (void)addNavigationItemWithImageNames:(NSArray *)imageNames
isLeft:(BOOL)isLeft
target:(id)target
action:(SEL)action
tags:(NSArray * _Nullable)tags;
/// 添加文字 不可点击的时候颜色
/// @param titles 文字的数组
/// @param titleColor 文字的颜色
/// @param isLeft 是否在左边
/// @param target 目标
/// @param action 点击
/// @param tags tag
- (void)addNavigationItemWithTitles:(NSArray *)titles titleColor:(UIColor *)titleColor isLeft:(BOOL)isLeft target:(id)target action:(SEL)action tags:(NSArray * _Nullable)tags;
/// 自定义的View
/// @param isLeft 是否在左边
- (void)addNavigationItemWithItems:(NSArray<UIView *> *)items
isLeft:(BOOL)isLeft;
@end
NS_ASSUME_NONNULL_END