MRAppDelegateComponents 0.1.0

MRAppDelegateComponents 0.1.0

ImageView 维护。



MRAppDelegateComponents

CI Status Version License Platform

AppDelegate 组件化拆分基础框架,可以让您将 AppDelegate 的多个复杂回调拆分到不同的模块中。

示例

要运行示例项目,请首先克隆仓库,然后在 Example 目录中运行 pod install

需求

  1. MRLoginInjection (实例逻辑注入框架)

安装

MRAppDelegateComponents 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'MRAppDelegateComponents'

用法

将需要拆分的逻辑单独拆成一个类,然后让该类实现协议 MRApplicationDelegateInjectionProtocol 即可。同时需要注意判断父类是否实现了对应方法,如果实现了则需要调用它。

#import <MRAppDelegateComponents/MRAppDelegateComponents.h>
@interface MRAppDelegateLogic1 () <UIApplicationDelegate, MRApplicationDelegateInjectionProtocol>

@end
@implementation MRAppDelegateLogic1
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    SEL sel = @selector(application:didFinishLaunchingWithOptions:);
    if (__MRSuperImplatationCurrentCMD__(sel)) {
        MRPrepareSendSuper(BOOL, id, id);
        MRSendSuperSelector(sel, application, launchOptions);
    }
    NSLog(@"MRAppDelegateLogic1 handle");
    return YES;
}
@end

作者

[email protected], [email protected]

许可

MRAppDelegateComponents 在MIT许可下可用。更多详情请查看LICENSE文件。