viewcontroller 协议优化
This commit is contained in:
@@ -6,32 +6,14 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol BaseMvpProtocol <NSObject>
|
||||
@protocol BaseMvpProtocol <NSObject, BaseViewControllerProtocol>
|
||||
|
||||
- (void)tokenInvalid;
|
||||
- (void)completeUserInfo;
|
||||
/**
|
||||
成功 toast
|
||||
*/
|
||||
- (void)showSuccessToast:(NSString *)msg;
|
||||
|
||||
/**
|
||||
失败 toast
|
||||
*/
|
||||
- (void)showErrorToast:(NSString *)msg;
|
||||
|
||||
/**
|
||||
加载 loading
|
||||
*/
|
||||
- (void)showLoading;
|
||||
|
||||
/**
|
||||
隐藏 XCHUDTool
|
||||
*/
|
||||
- (void)hideHUD;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -6,11 +6,34 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "BaseMvpProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface BaseViewController : UIViewController<BaseMvpProtocol>
|
||||
@protocol BaseViewControllerProtocol <NSObject>
|
||||
|
||||
/**
|
||||
成功 toast
|
||||
*/
|
||||
- (void)showSuccessToast:(NSString *)msg;
|
||||
|
||||
/**
|
||||
失败 toast
|
||||
*/
|
||||
- (void)showErrorToast:(NSString *)msg;
|
||||
|
||||
/**
|
||||
加载 loading
|
||||
*/
|
||||
- (void)showLoading;
|
||||
|
||||
/**
|
||||
隐藏 XCHUDTool
|
||||
*/
|
||||
- (void)hideHUD;
|
||||
|
||||
@end
|
||||
|
||||
@interface BaseViewController : UIViewController<BaseViewControllerProtocol>
|
||||
|
||||
// 是否隐藏导航 默认是不隐藏的
|
||||
@property(nonatomic,assign,getter=isHiddenNavBar) BOOL hiddenNavBar;
|
||||
|
@@ -74,7 +74,6 @@
|
||||
[self completeUserInfo];
|
||||
return;
|
||||
}
|
||||
self.selectedIndex = 0;
|
||||
}
|
||||
|
||||
- (void)tokenInvalid {
|
||||
@@ -116,7 +115,7 @@
|
||||
#ifdef DEBUG
|
||||
[fvcGame setName:@"debug" uniqueId:nil params:nil];
|
||||
#else
|
||||
[fvc setName:@"/" uniqueId:nil params:nil];
|
||||
[fvcGame setName:@"/" uniqueId:nil params:nil];
|
||||
#endif
|
||||
[self addChildViewController:[self createTabBarItem:fvcGame title:tabLabel[0] image:normalImageNames[0] selectedImage:selectImageNames[0]]];
|
||||
|
||||
@@ -124,7 +123,7 @@
|
||||
[self createTabBarItem:bvcMe title:tabLabel[1] image:normalImageNames[1] selectedImage:selectImageNames[1]];
|
||||
[self addChildViewController:bvcMe];
|
||||
|
||||
self.selectedIndex = 1;
|
||||
self.selectedIndex = 0;
|
||||
}
|
||||
|
||||
- (BaseNavigationController *)createTabBarItem:(UIViewController *)itemVc title:(NSString *)title image:(NSString *)image selectedImage:(NSString *)selectedImage{
|
||||
|
Reference in New Issue
Block a user