FWViewControllerManager
@interface FWViewControllerManager : NSObject
视图控制器管理器
Note
框架默认未注册FWViewController协议拦截器,如需全局配置控制器,使用全局自定义block即可-
单例模式
Declaration
Objective-C
@property (class, nonatomic, readonly) FWViewControllerManager *_Nonnull sharedInstance;
-
默认全局控制器init钩子句柄,init优先自动调用
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController *_Nonnull __strong) hookInit;
-
默认全局控制器loadView钩子句柄,loadView优先自动调用
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController *_Nonnull __strong) hookLoadView;
-
默认全局控制器viewDidLoad钩子句柄,viewDidLoad优先自动调用
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController *_Nonnull __strong) hookViewDidLoad;
-
默认全局控制器viewDidLayoutSubviews钩子句柄,viewDidLayoutSubviews优先自动调用
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController *_Nonnull __strong) hookViewDidLayoutSubviews;
-
默认全局scrollViewController钩子句柄,loadView自动调用,先于renderScrollView
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController<FWScrollViewController> *_Nonnull __strong) hookScrollViewController;
-
默认全局tableViewController钩子句柄,loadView自动调用,先于renderTableView
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController<FWTableViewController> *_Nonnull __strong) hookTableViewController;
-
默认全局collectionViewController钩子句柄,loadView自动调用,先于renderCollectionView
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController<FWCollectionViewController> *_Nonnull __strong) hookCollectionViewController;
-
默认全局webViewController钩子句柄,loadView自动调用,先于renderWebView
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (UIViewController<FWWebViewController> *_Nonnull __strong) hookWebViewController;
-
注册协议拦截器,提供拦截和跳转方法
Declaration
Objective-C
- (void)registerProtocol:(nonnull Protocol *)protocol withIntercepter:(nonnull FWViewControllerIntercepter *)intercepter;
-
调用控制器拦截方法默认实现并返回(如tableView等),由于实现机制无法通过super调用原始方法,提供此替代方案。如果未实现该协议或方法,返回nil
Declaration
Objective-C
- (nullable id)performIntercepter:(nonnull SEL)intercepter withObject:(nonnull UIViewController *)object;
-
调用控制器拦截方法默认实现并返回,可携带参数(如setWebRequest:等),由于实现机制无法通过super调用原始方法,提供此替代方案。如果未实现该协议或方法,返回nil
Declaration
Objective-C
- (nullable id)performIntercepter:(nonnull SEL)intercepter withObject:(nonnull UIViewController *)object parameter:(nullable id)parameter;