├── .DS_Store ├── .gitignore ├── LICENSE ├── README.md ├── WKAppDelegate-demo ├── Podfile ├── Podfile.lock ├── Pods │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ └── Pods-WKAppDelegate-demo │ │ ├── Pods-WKAppDelegate-demo-acknowledgements.markdown │ │ ├── Pods-WKAppDelegate-demo-acknowledgements.plist │ │ ├── Pods-WKAppDelegate-demo-dummy.m │ │ ├── Pods-WKAppDelegate-demo.debug.xcconfig │ │ └── Pods-WKAppDelegate-demo.release.xcconfig ├── WKAppDelegate-demo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── WKAppDelegate-demo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── WKAppDelegate-demo │ ├── APPEventModule │ ├── testLowLevelModule.h │ ├── testLowLevelModule.m │ ├── testMudule.h │ ├── testMudule.m │ ├── testRemoteNotificationModule.h │ └── testRemoteNotificationModule.m │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── toolbar │ │ ├── Contents.json │ │ ├── account_nor.imageset │ │ ├── Contents.json │ │ └── account_nor@2x.png │ │ ├── account_sel.imageset │ │ ├── Contents.json │ │ └── account_sel@2x.png │ │ ├── invest_nor.imageset │ │ ├── Contents.json │ │ └── invest_nor@2x.png │ │ ├── invest_sel.imageset │ │ ├── Contents.json │ │ └── invest_sel@2x.png │ │ ├── register_nor.imageset │ │ ├── Contents.json │ │ └── register_nor@2x.png │ │ ├── register_sel.imageset │ │ ├── Contents.json │ │ └── register_sel@2x.png │ │ ├── setting_nor.imageset │ │ ├── Contents.json │ │ └── setting_nor@2x.png │ │ └── setting_sel.imageset │ │ ├── Contents.json │ │ └── setting_sel@2x.png │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Bussiness │ ├── ComponentController.h │ ├── ComponentController.m │ ├── HomeController.h │ ├── HomeController.m │ ├── MyViewController.h │ ├── MyViewController.m │ ├── SetViewController.h │ └── SetViewController.m │ ├── Common │ └── UI │ │ ├── Toolbar │ │ ├── BaseButton.h │ │ ├── BaseButton.m │ │ ├── BaseToolbar.h │ │ ├── BaseToolbar.m │ │ ├── MainToolbar.h │ │ └── MainToolbar.m │ │ └── UIConfigDefine.h │ ├── Info.plist │ ├── MainView.h │ ├── MainView.m │ ├── MainViewController.h │ ├── MainViewController.m │ ├── WKAppDelegate │ ├── NSObject+AppEventModule.h │ ├── NSObject+AppEventModule.m │ ├── WKAppDelegate.h │ ├── WKAppDelegate.m │ ├── WKAppEventAnnotation.h │ ├── WKAppEventAnnotation.m │ ├── WKAppEventModuleManager.h │ ├── WKAppEventModuleManager.m │ ├── WKAppEventModuleProtocol.h │ ├── WKBaseAppEventModule.h │ └── WKBaseAppEventModule.m │ └── main.m ├── WKAppDelegate.podspec └── WKAppDelegate ├── NSObject+AppEventModule.h ├── NSObject+AppEventModule.m ├── WKAppDelegate.h ├── WKAppDelegate.m ├── WKAppEventAnnotation.h ├── WKAppEventAnnotation.m ├── WKAppEventModuleManager.h ├── WKAppEventModuleManager.m ├── WKAppEventModuleProtocol.h ├── WKBaseAppEventModule.h └── WKBaseAppEventModule.m /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 王凯 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WKAppDelegate 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/SHRMAppDelegate.svg?style=flat)](http://cocoapods.org/pods/SHRMAppDelegate) 4 | [![Pod License](http://img.shields.io/cocoapods/l/SHRMAppDelegate.svg?style=flat)](https://opensource.org/licenses/MIT) 5 | ![iOS 6.0+](https://img.shields.io/badge/iOS-6.0%2B-blue.svg) 6 | ![](https://img.shields.io/badge/language-objc-orange.svg) 7 | ![ARC](https://img.shields.io/badge/ARC-orange.svg) 8 | 9 | 10 | #### 注:在`v0.0.3`版本引入`NSObject+AppEventModule`分类,用以解决`NSObject`的`performSelector:`函数最多支持2个参数的问题。 11 | #### 注:`v0.0.7`版本进行了prefix变更,`SHRM`变更为`WK`。 12 | 13 | 14 | ## Link 15 | * Blog : [iOS 代码优化 -- AppDelegate模块化瘦身](https://juejin.im/post/5c62caf6e51d457fc905dd75) 16 | 17 | ## 介绍 18 | **一个对APPDelegate深度解耦的逻辑,教你实现APPDelegate模块化拆分,原本上千行的代码可以简化到10行内,使用方便,极少的代码浸入。支持iOS6+** 19 | ![image text](https://user-gold-cdn.xitu.io/2019/2/12/168e20a0d3b1bb53?imageslim) 20 | 21 | **AppDelegate简化后的样子:** 22 | 23 | ```objc 24 | #import "WKAppDelegate.h" 25 | @interface AppDelegate : WKAppDelegate 26 | @property (strong, nonatomic) UIWindow *window; 27 | @end 28 | ``` 29 | ```objc 30 | #import "MainViewController.h" 31 | @implementation AppDelegate 32 | @synthesize window; 33 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 34 | [super application:application didFinishLaunchingWithOptions:launchOptions]; 35 | [self initMainController]; 36 | return YES; 37 | } 38 | 39 | - (void)initMainController { 40 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 41 | self.window.backgroundColor = [UIColor whiteColor]; 42 | self.window.rootViewController = [[MainViewController alloc] init]; 43 | [self.window makeKeyAndVisible]; 44 | } 45 | @end 46 | ``` 47 | **你没看错,引入框架后,你的AppDelegate只有这些代码!怎么做的?看demo。** 48 | 49 | ## 特性 50 | 51 | - 搭积木式设计,业务插件化分离。 52 | - `AppDelegate.m`内的代码精简到10行内。 53 | - 原有的功能模块拆分为单独的子模块,模块独立,模块间无耦合。 54 | - 每个模块都拥有自己的生命周期,目前支持模块的初始化->销毁。 55 | - 模块可自定义执行的优先级,也就是说可以自定义原`AppDelegate`中不同业务功能的加载顺序。 56 | - 模块扩展性高,易于维护,新需求只需新增模块即可,顺便在模块内部管理下该模块的生命周期。 57 | - 代码可读性强,每个模块只负责该模块内的业务。 58 | - 模块支持插拔,需要就拖到项目中,不需要删除也不影响项目build! 59 | - 其他特性demo中自己挖掘。 60 | 61 | ## 安装 62 | 63 | ### 1.CocoaPods 64 | 1. 在 Podfile 中添加 `pod 'WKAppDelegate', '~> 0.0.7'`。 65 | 2. 执行 `pod install` 或 `pod update`。 66 | 3. 在AppDelegate中导入 ``并继承。 67 | 68 | 69 | ### 2.手动导入 70 | 71 | 下载WKAppDelegate文件夹,将WKAppDelegate文件夹拖入到你的工程中。 72 | 73 | ## 用法 74 | 75 | - `WKAppDelegate`为对外暴漏的主体类,内部实现了所有的App生命周期方法,当然你也可以指定实现哪一类方法,或者不需要框架实现,只需要在你的`AppDelegate`中重写即可。 76 | - `WKAppEventModuleManager`是模块的管理类,管理着所有注册过的模块。 77 | - `WKBaseAppEventModule`是所有模块需要继承的基类,为所有模块提供公共方法,包括模块执行顺序,模块生命周期管理等,可自行扩充。 78 | - `WKAppEventAnnotation`为模块注册专用类,每个模块都需要注册的,为什么注册?不注册怎么管理呢。 79 | - `NSObject+AppEventModule`为NSObject分类,扩充了`NSObject`的`performSelector:`函数,用以支持多参传递。 80 | 81 | ### 1.`AppDelegate`继承`WKAppDelegate`,让`WKAppDelegate`来接管App的生命周期函数。 82 | ### 2.创建插件,继承`WKBaseAppEventModule`: 83 | 84 | ```objc 85 | #import "WKBaseAppEventModule.h" 86 | 87 | @interface testMudule : WKBaseAppEventModule 88 | 89 | @end 90 | ``` 91 | ```objc 92 | WKAppEventMod(testMudule) 93 | 94 | @implementation testMudule 95 | 96 | // 该插件执行顺序 97 | - (NSInteger)moduleLevel { 98 | return 1; 99 | } 100 | 101 | //该插件需要在didFinishLaunchingWithOptions:生命周期函数中做些操作 102 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 103 | //插件初始化 104 | [self initMudule]; 105 | //插件销毁,父类实现 106 | [self destroyModule]; 107 | return YES; 108 | } 109 | 110 | - (void)initMudule { 111 | NSLog(@"testMudule init"); 112 | } 113 | 114 | @end 115 | ``` 116 | **插件概念:每个插件都为独立的业务,比如程序启动后的数据库处理、定位处理等都可以定义为一个插件,让插件继承`WKBaseAppEventModule`插件就会被管理。如果想在程序启动的时候执行该插件就在该插件里面重写`didFinishLaunchingWithOptions:`即可,如上。如果想在程序进入后台执行该插件的一些业务那么只需要重写`applicationDidEnterBackground:`即可,然后在该函数里面进行业务处理。** 117 | 118 | ### 3.如果需要自己实现App周期函数只需要在你的AppDelegate重写即可。 119 | 120 | ### 4.NSObject+AppEventModule分类 121 | 122 | 提供`performSelector:`函数传递多个参数的解决方案,基于`NSMethodSignature`和`NSInvocation`实现。核心代码如下: 123 | 124 | ```objc 125 | - (id)performSelector:(SEL)selector 126 | withObject:(id)p1 127 | withObject:(id)p2 128 | withObject:(id)p3 { 129 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 130 | if (sig) { 131 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 132 | [invo setTarget:self]; 133 | [invo setSelector:selector]; 134 | [invo setArgument:&p1 atIndex:2]; 135 | [invo setArgument:&p2 atIndex:3]; 136 | [invo setArgument:&p3 atIndex:4]; 137 | [invo invoke]; 138 | if (sig.methodReturnLength) { 139 | return [self handleReturnType:sig invo:invo]; 140 | } else { 141 | return nil; 142 | } 143 | } else { 144 | return nil; 145 | } 146 | } 147 | ``` 148 | 149 | ```objc 150 | - (id)handleReturnType:(NSMethodSignature *)sig invo:(NSInvocation *)aInvo 151 | { 152 | int booResult = strcmp([sig methodReturnType], @encode(BOOL)); 153 | int floatResult = strcmp([sig methodReturnType], @encode(float)); 154 | int intResult = strcmp([sig methodReturnType], @encode(int)); 155 | 156 | id anObject = nil; 157 | if (booResult == 0) 158 | { 159 | BOOL result; 160 | [aInvo getReturnValue:&result]; 161 | anObject = [NSNumber numberWithBool:result]; 162 | } 163 | else if (floatResult == 0) 164 | { 165 | float result; 166 | [aInvo getReturnValue:&result]; 167 | anObject = [NSNumber numberWithFloat:result]; 168 | } 169 | else if (intResult) 170 | { 171 | int result; 172 | [aInvo getReturnValue:&result]; 173 | anObject = [NSNumber numberWithInt:result]; 174 | } 175 | return anObject; 176 | } 177 | ``` 178 | 179 | ### 5.详细使用请参照demo,如有疑问欢迎issue,欢迎star。 180 | 181 | ## License 182 | 183 | WKAppDelegate is available under the MIT License. See the [LICENSE](https://github.com/GitWangKai/WKAppDelegate/blob/master/LICENSE) file for more info. 184 | 185 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'WKAppDelegate-demo' do 5 | 6 | 7 | 8 | end 9 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODFILE CHECKSUM: 1fc73733e15f3a10abdfe27514bfce4350f26255 2 | 3 | COCOAPODS: 1.6.1 4 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODFILE CHECKSUM: 1fc73733e15f3a10abdfe27514bfce4350f26255 2 | 3 | COCOAPODS: 1.6.1 4 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3017330C23E3624D0B2119152982C277 /* Pods-WKAppDelegate-demo-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A289A65B5A6C8E94EE48336359D18455 /* Pods-WKAppDelegate-demo-dummy.m */; }; 11 | /* End PBXBuildFile section */ 12 | 13 | /* Begin PBXFileReference section */ 14 | 0B516C29C90326235AFF3DFD39622EE6 /* Pods-WKAppDelegate-demo-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-WKAppDelegate-demo-acknowledgements.plist"; sourceTree = ""; }; 15 | 8F073CEC27320FB10A87404E4F4A50D4 /* Pods-WKAppDelegate-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-WKAppDelegate-demo.debug.xcconfig"; sourceTree = ""; }; 16 | 95FD5DF1AEBBACCD905C1921D2221833 /* Pods-WKAppDelegate-demo-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-WKAppDelegate-demo-acknowledgements.markdown"; sourceTree = ""; }; 17 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 18 | A289A65B5A6C8E94EE48336359D18455 /* Pods-WKAppDelegate-demo-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-WKAppDelegate-demo-dummy.m"; sourceTree = ""; }; 19 | E95CF9CA44D3663FF85924F9C3B57CFB /* libPods-WKAppDelegate-demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-WKAppDelegate-demo.a"; path = "libPods-WKAppDelegate-demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | FB74B3A81C39267F2327AB0C3D78FA2C /* Pods-WKAppDelegate-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-WKAppDelegate-demo.release.xcconfig"; sourceTree = ""; }; 21 | /* End PBXFileReference section */ 22 | 23 | /* Begin PBXFrameworksBuildPhase section */ 24 | 0D7CD47E9D79A86A35D6F8CC03BDAA7E /* Frameworks */ = { 25 | isa = PBXFrameworksBuildPhase; 26 | buildActionMask = 2147483647; 27 | files = ( 28 | ); 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXFrameworksBuildPhase section */ 32 | 33 | /* Begin PBXGroup section */ 34 | 0D7A570C7193DA13B8BDE77F06DAB839 /* Pods-WKAppDelegate-demo */ = { 35 | isa = PBXGroup; 36 | children = ( 37 | 95FD5DF1AEBBACCD905C1921D2221833 /* Pods-WKAppDelegate-demo-acknowledgements.markdown */, 38 | 0B516C29C90326235AFF3DFD39622EE6 /* Pods-WKAppDelegate-demo-acknowledgements.plist */, 39 | A289A65B5A6C8E94EE48336359D18455 /* Pods-WKAppDelegate-demo-dummy.m */, 40 | 8F073CEC27320FB10A87404E4F4A50D4 /* Pods-WKAppDelegate-demo.debug.xcconfig */, 41 | FB74B3A81C39267F2327AB0C3D78FA2C /* Pods-WKAppDelegate-demo.release.xcconfig */, 42 | ); 43 | name = "Pods-WKAppDelegate-demo"; 44 | path = "Target Support Files/Pods-WKAppDelegate-demo"; 45 | sourceTree = ""; 46 | }; 47 | 15F51E0A0107B4197EC16F29AF169708 /* Targets Support Files */ = { 48 | isa = PBXGroup; 49 | children = ( 50 | 0D7A570C7193DA13B8BDE77F06DAB839 /* Pods-WKAppDelegate-demo */, 51 | ); 52 | name = "Targets Support Files"; 53 | sourceTree = ""; 54 | }; 55 | CE8EB7A20AE8483671A55DED2302F02A /* Products */ = { 56 | isa = PBXGroup; 57 | children = ( 58 | E95CF9CA44D3663FF85924F9C3B57CFB /* libPods-WKAppDelegate-demo.a */, 59 | ); 60 | name = Products; 61 | sourceTree = ""; 62 | }; 63 | CF1408CF629C7361332E53B88F7BD30C = { 64 | isa = PBXGroup; 65 | children = ( 66 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, 67 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */, 68 | CE8EB7A20AE8483671A55DED2302F02A /* Products */, 69 | 15F51E0A0107B4197EC16F29AF169708 /* Targets Support Files */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | ); 77 | name = Frameworks; 78 | sourceTree = ""; 79 | }; 80 | /* End PBXGroup section */ 81 | 82 | /* Begin PBXHeadersBuildPhase section */ 83 | 13AA33FF4933769A7E0D215791621FC3 /* Headers */ = { 84 | isa = PBXHeadersBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXHeadersBuildPhase section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | CD9B6756170297ACABFFA5145442CA1C /* Pods-WKAppDelegate-demo */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = 671265280185749414B3B7D72A105C9A /* Build configuration list for PBXNativeTarget "Pods-WKAppDelegate-demo" */; 96 | buildPhases = ( 97 | 13AA33FF4933769A7E0D215791621FC3 /* Headers */, 98 | BA61D0EB7C1AEB972E2907D9FD475721 /* Sources */, 99 | 0D7CD47E9D79A86A35D6F8CC03BDAA7E /* Frameworks */, 100 | ); 101 | buildRules = ( 102 | ); 103 | dependencies = ( 104 | ); 105 | name = "Pods-WKAppDelegate-demo"; 106 | productName = "Pods-WKAppDelegate-demo"; 107 | productReference = E95CF9CA44D3663FF85924F9C3B57CFB /* libPods-WKAppDelegate-demo.a */; 108 | productType = "com.apple.product-type.library.static"; 109 | }; 110 | /* End PBXNativeTarget section */ 111 | 112 | /* Begin PBXProject section */ 113 | BFDFE7DC352907FC980B868725387E98 /* Project object */ = { 114 | isa = PBXProject; 115 | attributes = { 116 | LastSwiftUpdateCheck = 0930; 117 | LastUpgradeCheck = 0930; 118 | }; 119 | buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; 120 | compatibilityVersion = "Xcode 3.2"; 121 | developmentRegion = English; 122 | hasScannedForEncodings = 0; 123 | knownRegions = ( 124 | en, 125 | ); 126 | mainGroup = CF1408CF629C7361332E53B88F7BD30C; 127 | productRefGroup = CE8EB7A20AE8483671A55DED2302F02A /* Products */; 128 | projectDirPath = ""; 129 | projectRoot = ""; 130 | targets = ( 131 | CD9B6756170297ACABFFA5145442CA1C /* Pods-WKAppDelegate-demo */, 132 | ); 133 | }; 134 | /* End PBXProject section */ 135 | 136 | /* Begin PBXSourcesBuildPhase section */ 137 | BA61D0EB7C1AEB972E2907D9FD475721 /* Sources */ = { 138 | isa = PBXSourcesBuildPhase; 139 | buildActionMask = 2147483647; 140 | files = ( 141 | 3017330C23E3624D0B2119152982C277 /* Pods-WKAppDelegate-demo-dummy.m in Sources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXSourcesBuildPhase section */ 146 | 147 | /* Begin XCBuildConfiguration section */ 148 | 204E65586C4B20FDD70568DE110A59F4 /* Release */ = { 149 | isa = XCBuildConfiguration; 150 | baseConfigurationReference = FB74B3A81C39267F2327AB0C3D78FA2C /* Pods-WKAppDelegate-demo.release.xcconfig */; 151 | buildSettings = { 152 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 153 | CLANG_ENABLE_OBJC_WEAK = NO; 154 | CODE_SIGN_IDENTITY = "iPhone Developer"; 155 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 156 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 157 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 158 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 159 | MACH_O_TYPE = staticlib; 160 | OTHER_LDFLAGS = ""; 161 | OTHER_LIBTOOLFLAGS = ""; 162 | PODS_ROOT = "$(SRCROOT)"; 163 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 164 | SDKROOT = iphoneos; 165 | SKIP_INSTALL = YES; 166 | TARGETED_DEVICE_FAMILY = "1,2"; 167 | VALIDATE_PRODUCT = YES; 168 | }; 169 | name = Release; 170 | }; 171 | 4093433A309EFE160336AC736594AB22 /* Debug */ = { 172 | isa = XCBuildConfiguration; 173 | buildSettings = { 174 | ALWAYS_SEARCH_USER_PATHS = NO; 175 | CLANG_ANALYZER_NONNULL = YES; 176 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 177 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 178 | CLANG_CXX_LIBRARY = "libc++"; 179 | CLANG_ENABLE_MODULES = YES; 180 | CLANG_ENABLE_OBJC_ARC = YES; 181 | CLANG_ENABLE_OBJC_WEAK = YES; 182 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 183 | CLANG_WARN_BOOL_CONVERSION = YES; 184 | CLANG_WARN_COMMA = YES; 185 | CLANG_WARN_CONSTANT_CONVERSION = YES; 186 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 187 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 188 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 189 | CLANG_WARN_EMPTY_BODY = YES; 190 | CLANG_WARN_ENUM_CONVERSION = YES; 191 | CLANG_WARN_INFINITE_RECURSION = YES; 192 | CLANG_WARN_INT_CONVERSION = YES; 193 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 194 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 195 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 196 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 197 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 198 | CLANG_WARN_STRICT_PROTOTYPES = YES; 199 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 200 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 201 | CLANG_WARN_UNREACHABLE_CODE = YES; 202 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 203 | COPY_PHASE_STRIP = NO; 204 | DEBUG_INFORMATION_FORMAT = dwarf; 205 | ENABLE_STRICT_OBJC_MSGSEND = YES; 206 | ENABLE_TESTABILITY = YES; 207 | GCC_C_LANGUAGE_STANDARD = gnu11; 208 | GCC_DYNAMIC_NO_PIC = NO; 209 | GCC_NO_COMMON_BLOCKS = YES; 210 | GCC_OPTIMIZATION_LEVEL = 0; 211 | GCC_PREPROCESSOR_DEFINITIONS = ( 212 | "POD_CONFIGURATION_DEBUG=1", 213 | "DEBUG=1", 214 | "$(inherited)", 215 | ); 216 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 217 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 218 | GCC_WARN_UNDECLARED_SELECTOR = YES; 219 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 220 | GCC_WARN_UNUSED_FUNCTION = YES; 221 | GCC_WARN_UNUSED_VARIABLE = YES; 222 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 223 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 224 | MTL_FAST_MATH = YES; 225 | ONLY_ACTIVE_ARCH = YES; 226 | PRODUCT_NAME = "$(TARGET_NAME)"; 227 | STRIP_INSTALLED_PRODUCT = NO; 228 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 229 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 230 | SWIFT_VERSION = 4.2; 231 | SYMROOT = "${SRCROOT}/../build"; 232 | }; 233 | name = Debug; 234 | }; 235 | 47274962F92D4C5E851ECEB4D339922C /* Debug */ = { 236 | isa = XCBuildConfiguration; 237 | baseConfigurationReference = 8F073CEC27320FB10A87404E4F4A50D4 /* Pods-WKAppDelegate-demo.debug.xcconfig */; 238 | buildSettings = { 239 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 240 | CLANG_ENABLE_OBJC_WEAK = NO; 241 | CODE_SIGN_IDENTITY = "iPhone Developer"; 242 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 243 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 244 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 245 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 246 | MACH_O_TYPE = staticlib; 247 | OTHER_LDFLAGS = ""; 248 | OTHER_LIBTOOLFLAGS = ""; 249 | PODS_ROOT = "$(SRCROOT)"; 250 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 251 | SDKROOT = iphoneos; 252 | SKIP_INSTALL = YES; 253 | TARGETED_DEVICE_FAMILY = "1,2"; 254 | }; 255 | name = Debug; 256 | }; 257 | 924D56B1D59CD3049300EAEEA256114E /* Release */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 263 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 264 | CLANG_CXX_LIBRARY = "libc++"; 265 | CLANG_ENABLE_MODULES = YES; 266 | CLANG_ENABLE_OBJC_ARC = YES; 267 | CLANG_ENABLE_OBJC_WEAK = YES; 268 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 269 | CLANG_WARN_BOOL_CONVERSION = YES; 270 | CLANG_WARN_COMMA = YES; 271 | CLANG_WARN_CONSTANT_CONVERSION = YES; 272 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 273 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 274 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 281 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 282 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 283 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 284 | CLANG_WARN_STRICT_PROTOTYPES = YES; 285 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 286 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 287 | CLANG_WARN_UNREACHABLE_CODE = YES; 288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 289 | COPY_PHASE_STRIP = NO; 290 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 291 | ENABLE_NS_ASSERTIONS = NO; 292 | ENABLE_STRICT_OBJC_MSGSEND = YES; 293 | GCC_C_LANGUAGE_STANDARD = gnu11; 294 | GCC_NO_COMMON_BLOCKS = YES; 295 | GCC_PREPROCESSOR_DEFINITIONS = ( 296 | "POD_CONFIGURATION_RELEASE=1", 297 | "$(inherited)", 298 | ); 299 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 300 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 301 | GCC_WARN_UNDECLARED_SELECTOR = YES; 302 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 303 | GCC_WARN_UNUSED_FUNCTION = YES; 304 | GCC_WARN_UNUSED_VARIABLE = YES; 305 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 306 | MTL_ENABLE_DEBUG_INFO = NO; 307 | MTL_FAST_MATH = YES; 308 | PRODUCT_NAME = "$(TARGET_NAME)"; 309 | STRIP_INSTALLED_PRODUCT = NO; 310 | SWIFT_COMPILATION_MODE = wholemodule; 311 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 312 | SWIFT_VERSION = 4.2; 313 | SYMROOT = "${SRCROOT}/../build"; 314 | }; 315 | name = Release; 316 | }; 317 | /* End XCBuildConfiguration section */ 318 | 319 | /* Begin XCConfigurationList section */ 320 | 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 4093433A309EFE160336AC736594AB22 /* Debug */, 324 | 924D56B1D59CD3049300EAEEA256114E /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | 671265280185749414B3B7D72A105C9A /* Build configuration list for PBXNativeTarget "Pods-WKAppDelegate-demo" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | 47274962F92D4C5E851ECEB4D339922C /* Debug */, 333 | 204E65586C4B20FDD70568DE110A59F4 /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | defaultConfigurationName = Release; 337 | }; 338 | /* End XCConfigurationList section */ 339 | }; 340 | rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; 341 | } 342 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Pods/Target Support Files/Pods-WKAppDelegate-demo/Pods-WKAppDelegate-demo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Pods/Target Support Files/Pods-WKAppDelegate-demo/Pods-WKAppDelegate-demo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Pods/Target Support Files/Pods-WKAppDelegate-demo/Pods-WKAppDelegate-demo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_WKAppDelegate_demo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_WKAppDelegate_demo 5 | @end 6 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Pods/Target Support Files/Pods-WKAppDelegate-demo/Pods-WKAppDelegate-demo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | OTHER_LDFLAGS = $(inherited) -ObjC 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/Pods/Target Support Files/Pods-WKAppDelegate-demo/Pods-WKAppDelegate-demo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | OTHER_LDFLAGS = $(inherited) -ObjC 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0A7648DC232F3ABF006C6FFA /* NSObject+AppEventModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A7648D1232F3ABF006C6FFA /* NSObject+AppEventModule.m */; }; 11 | 0A7648DD232F3ABF006C6FFA /* WKAppEventModuleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A7648D5232F3ABF006C6FFA /* WKAppEventModuleManager.m */; }; 12 | 0A7648DE232F3ABF006C6FFA /* WKBaseAppEventModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A7648D7232F3ABF006C6FFA /* WKBaseAppEventModule.m */; }; 13 | 0A7648DF232F3ABF006C6FFA /* WKAppEventAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A7648D8232F3ABF006C6FFA /* WKAppEventAnnotation.m */; }; 14 | 0A7648E0232F3ABF006C6FFA /* WKAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A7648DA232F3ABF006C6FFA /* WKAppDelegate.m */; }; 15 | 0A8B04952282CADA00A7EB06 /* testRemoteNotificationModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A8B04942282CADA00A7EB06 /* testRemoteNotificationModule.m */; }; 16 | 326F369F262401F90AEBD0F0 /* libPods-WKAppDelegate-demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 098C7D922B51540EF2379631 /* libPods-WKAppDelegate-demo.a */; }; 17 | 83A00FBE22129F7600A12191 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FBD22129F7600A12191 /* AppDelegate.m */; }; 18 | 83A00FC422129F7600A12191 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83A00FC222129F7600A12191 /* Main.storyboard */; }; 19 | 83A00FC622129F7800A12191 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83A00FC522129F7800A12191 /* Assets.xcassets */; }; 20 | 83A00FC922129F7800A12191 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83A00FC722129F7800A12191 /* LaunchScreen.storyboard */; }; 21 | 83A00FCC22129F7800A12191 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FCB22129F7800A12191 /* main.m */; }; 22 | 83A00FE32212B34D00A12191 /* testMudule.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FE22212B34D00A12191 /* testMudule.m */; }; 23 | 83A00FE62212C16200A12191 /* testLowLevelModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FE52212C16200A12191 /* testLowLevelModule.m */; }; 24 | 83A00FE92212C39300A12191 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FE82212C39300A12191 /* MainViewController.m */; }; 25 | 83A00FEC2214045400A12191 /* MainView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FEB2214045400A12191 /* MainView.m */; }; 26 | 83A01001221417BD00A12191 /* MainToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FFB221417BD00A12191 /* MainToolbar.m */; }; 27 | 83A01002221417BD00A12191 /* BaseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A00FFF221417BD00A12191 /* BaseButton.m */; }; 28 | 83A01003221417BD00A12191 /* BaseToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A01000221417BD00A12191 /* BaseToolbar.m */; }; 29 | 83A010072214185F00A12191 /* HomeController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A010062214185F00A12191 /* HomeController.m */; }; 30 | 83A0100A2214187000A12191 /* MyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A010092214187000A12191 /* MyViewController.m */; }; 31 | 83A0100D2214188F00A12191 /* ComponentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A0100C2214188F00A12191 /* ComponentController.m */; }; 32 | 83A010102214189A00A12191 /* SetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A0100F2214189A00A12191 /* SetViewController.m */; }; 33 | /* End PBXBuildFile section */ 34 | 35 | /* Begin PBXFileReference section */ 36 | 098C7D922B51540EF2379631 /* libPods-WKAppDelegate-demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WKAppDelegate-demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 0A7648D1232F3ABF006C6FFA /* NSObject+AppEventModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+AppEventModule.m"; sourceTree = ""; }; 38 | 0A7648D2232F3ABF006C6FFA /* WKAppEventAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAppEventAnnotation.h; sourceTree = ""; }; 39 | 0A7648D3232F3ABF006C6FFA /* WKBaseAppEventModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBaseAppEventModule.h; sourceTree = ""; }; 40 | 0A7648D4232F3ABF006C6FFA /* WKAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAppDelegate.h; sourceTree = ""; }; 41 | 0A7648D5232F3ABF006C6FFA /* WKAppEventModuleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKAppEventModuleManager.m; sourceTree = ""; }; 42 | 0A7648D6232F3ABF006C6FFA /* NSObject+AppEventModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+AppEventModule.h"; sourceTree = ""; }; 43 | 0A7648D7232F3ABF006C6FFA /* WKBaseAppEventModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKBaseAppEventModule.m; sourceTree = ""; }; 44 | 0A7648D8232F3ABF006C6FFA /* WKAppEventAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKAppEventAnnotation.m; sourceTree = ""; }; 45 | 0A7648D9232F3ABF006C6FFA /* WKAppEventModuleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAppEventModuleManager.h; sourceTree = ""; }; 46 | 0A7648DA232F3ABF006C6FFA /* WKAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKAppDelegate.m; sourceTree = ""; }; 47 | 0A7648DB232F3ABF006C6FFA /* WKAppEventModuleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAppEventModuleProtocol.h; sourceTree = ""; }; 48 | 0A8B04932282CADA00A7EB06 /* testRemoteNotificationModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = testRemoteNotificationModule.h; sourceTree = ""; }; 49 | 0A8B04942282CADA00A7EB06 /* testRemoteNotificationModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = testRemoteNotificationModule.m; sourceTree = ""; }; 50 | 83A00FB922129F7600A12191 /* WKAppDelegate-demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "WKAppDelegate-demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 83A00FBC22129F7600A12191 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 52 | 83A00FBD22129F7600A12191 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 53 | 83A00FC322129F7600A12191 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54 | 83A00FC522129F7800A12191 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 55 | 83A00FC822129F7800A12191 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 56 | 83A00FCA22129F7800A12191 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 83A00FCB22129F7800A12191 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 58 | 83A00FE12212B34D00A12191 /* testMudule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = testMudule.h; sourceTree = ""; }; 59 | 83A00FE22212B34D00A12191 /* testMudule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = testMudule.m; sourceTree = ""; }; 60 | 83A00FE42212C16200A12191 /* testLowLevelModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = testLowLevelModule.h; sourceTree = ""; }; 61 | 83A00FE52212C16200A12191 /* testLowLevelModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = testLowLevelModule.m; sourceTree = ""; }; 62 | 83A00FE72212C39300A12191 /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 63 | 83A00FE82212C39300A12191 /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 64 | 83A00FEA2214045400A12191 /* MainView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainView.h; sourceTree = ""; }; 65 | 83A00FEB2214045400A12191 /* MainView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainView.m; sourceTree = ""; }; 66 | 83A00FF32214072300A12191 /* UIConfigDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIConfigDefine.h; sourceTree = ""; }; 67 | 83A00FFB221417BD00A12191 /* MainToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainToolbar.m; sourceTree = ""; }; 68 | 83A00FFC221417BD00A12191 /* BaseButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseButton.h; sourceTree = ""; }; 69 | 83A00FFD221417BD00A12191 /* BaseToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseToolbar.h; sourceTree = ""; }; 70 | 83A00FFE221417BD00A12191 /* MainToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainToolbar.h; sourceTree = ""; }; 71 | 83A00FFF221417BD00A12191 /* BaseButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseButton.m; sourceTree = ""; }; 72 | 83A01000221417BD00A12191 /* BaseToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseToolbar.m; sourceTree = ""; }; 73 | 83A010052214185F00A12191 /* HomeController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeController.h; sourceTree = ""; }; 74 | 83A010062214185F00A12191 /* HomeController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeController.m; sourceTree = ""; }; 75 | 83A010082214187000A12191 /* MyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyViewController.h; sourceTree = ""; }; 76 | 83A010092214187000A12191 /* MyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyViewController.m; sourceTree = ""; }; 77 | 83A0100B2214188F00A12191 /* ComponentController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ComponentController.h; sourceTree = ""; }; 78 | 83A0100C2214188F00A12191 /* ComponentController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ComponentController.m; sourceTree = ""; }; 79 | 83A0100E2214189A00A12191 /* SetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SetViewController.h; sourceTree = ""; }; 80 | 83A0100F2214189A00A12191 /* SetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SetViewController.m; sourceTree = ""; }; 81 | C8DB89397148A3D0A5BB66A8 /* Pods-WKAppDelegate-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKAppDelegate-demo.debug.xcconfig"; path = "Target Support Files/Pods-WKAppDelegate-demo/Pods-WKAppDelegate-demo.debug.xcconfig"; sourceTree = ""; }; 82 | D3875AB90B1FB313E3327EF5 /* Pods-WKAppDelegate-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKAppDelegate-demo.release.xcconfig"; path = "Target Support Files/Pods-WKAppDelegate-demo/Pods-WKAppDelegate-demo.release.xcconfig"; sourceTree = ""; }; 83 | /* End PBXFileReference section */ 84 | 85 | /* Begin PBXFrameworksBuildPhase section */ 86 | 83A00FB622129F7600A12191 /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | 326F369F262401F90AEBD0F0 /* libPods-WKAppDelegate-demo.a in Frameworks */, 91 | ); 92 | runOnlyForDeploymentPostprocessing = 0; 93 | }; 94 | /* End PBXFrameworksBuildPhase section */ 95 | 96 | /* Begin PBXGroup section */ 97 | 0A7648D0232F3ABF006C6FFA /* WKAppDelegate */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 0A7648D1232F3ABF006C6FFA /* NSObject+AppEventModule.m */, 101 | 0A7648D2232F3ABF006C6FFA /* WKAppEventAnnotation.h */, 102 | 0A7648D3232F3ABF006C6FFA /* WKBaseAppEventModule.h */, 103 | 0A7648D4232F3ABF006C6FFA /* WKAppDelegate.h */, 104 | 0A7648D5232F3ABF006C6FFA /* WKAppEventModuleManager.m */, 105 | 0A7648D6232F3ABF006C6FFA /* NSObject+AppEventModule.h */, 106 | 0A7648D7232F3ABF006C6FFA /* WKBaseAppEventModule.m */, 107 | 0A7648D8232F3ABF006C6FFA /* WKAppEventAnnotation.m */, 108 | 0A7648D9232F3ABF006C6FFA /* WKAppEventModuleManager.h */, 109 | 0A7648DA232F3ABF006C6FFA /* WKAppDelegate.m */, 110 | 0A7648DB232F3ABF006C6FFA /* WKAppEventModuleProtocol.h */, 111 | ); 112 | path = WKAppDelegate; 113 | sourceTree = ""; 114 | }; 115 | 83A00FB022129F7600A12191 = { 116 | isa = PBXGroup; 117 | children = ( 118 | 83A00FBB22129F7600A12191 /* WKAppDelegate-demo */, 119 | 83A00FBA22129F7600A12191 /* Products */, 120 | 9D0BEFA860CFB5E7E9415BF2 /* Pods */, 121 | 8A2D7A747B93FA7CB090862D /* Frameworks */, 122 | ); 123 | sourceTree = ""; 124 | }; 125 | 83A00FBA22129F7600A12191 /* Products */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 83A00FB922129F7600A12191 /* WKAppDelegate-demo.app */, 129 | ); 130 | name = Products; 131 | sourceTree = ""; 132 | }; 133 | 83A00FBB22129F7600A12191 /* WKAppDelegate-demo */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 0A7648D0232F3ABF006C6FFA /* WKAppDelegate */, 137 | 83A010042214181500A12191 /* Bussiness */, 138 | 83A00FED2214055500A12191 /* Common */, 139 | 83A00FE02212AF1F00A12191 /* APPEventModule */, 140 | 83A00FBC22129F7600A12191 /* AppDelegate.h */, 141 | 83A00FBD22129F7600A12191 /* AppDelegate.m */, 142 | 83A00FC222129F7600A12191 /* Main.storyboard */, 143 | 83A00FC522129F7800A12191 /* Assets.xcassets */, 144 | 83A00FC722129F7800A12191 /* LaunchScreen.storyboard */, 145 | 83A00FCA22129F7800A12191 /* Info.plist */, 146 | 83A00FCB22129F7800A12191 /* main.m */, 147 | 83A00FE72212C39300A12191 /* MainViewController.h */, 148 | 83A00FE82212C39300A12191 /* MainViewController.m */, 149 | 83A00FEA2214045400A12191 /* MainView.h */, 150 | 83A00FEB2214045400A12191 /* MainView.m */, 151 | ); 152 | path = "WKAppDelegate-demo"; 153 | sourceTree = ""; 154 | }; 155 | 83A00FE02212AF1F00A12191 /* APPEventModule */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 83A00FE12212B34D00A12191 /* testMudule.h */, 159 | 83A00FE22212B34D00A12191 /* testMudule.m */, 160 | 83A00FE42212C16200A12191 /* testLowLevelModule.h */, 161 | 83A00FE52212C16200A12191 /* testLowLevelModule.m */, 162 | 0A8B04932282CADA00A7EB06 /* testRemoteNotificationModule.h */, 163 | 0A8B04942282CADA00A7EB06 /* testRemoteNotificationModule.m */, 164 | ); 165 | path = APPEventModule; 166 | sourceTree = ""; 167 | }; 168 | 83A00FED2214055500A12191 /* Common */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 83A00FEE2214056500A12191 /* UI */, 172 | ); 173 | path = Common; 174 | sourceTree = ""; 175 | }; 176 | 83A00FEE2214056500A12191 /* UI */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | 83A00FFA221417BD00A12191 /* Toolbar */, 180 | 83A00FF32214072300A12191 /* UIConfigDefine.h */, 181 | ); 182 | path = UI; 183 | sourceTree = ""; 184 | }; 185 | 83A00FFA221417BD00A12191 /* Toolbar */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 83A00FFB221417BD00A12191 /* MainToolbar.m */, 189 | 83A00FFC221417BD00A12191 /* BaseButton.h */, 190 | 83A00FFD221417BD00A12191 /* BaseToolbar.h */, 191 | 83A00FFE221417BD00A12191 /* MainToolbar.h */, 192 | 83A00FFF221417BD00A12191 /* BaseButton.m */, 193 | 83A01000221417BD00A12191 /* BaseToolbar.m */, 194 | ); 195 | path = Toolbar; 196 | sourceTree = ""; 197 | }; 198 | 83A010042214181500A12191 /* Bussiness */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | 83A010052214185F00A12191 /* HomeController.h */, 202 | 83A010062214185F00A12191 /* HomeController.m */, 203 | 83A010082214187000A12191 /* MyViewController.h */, 204 | 83A010092214187000A12191 /* MyViewController.m */, 205 | 83A0100B2214188F00A12191 /* ComponentController.h */, 206 | 83A0100C2214188F00A12191 /* ComponentController.m */, 207 | 83A0100E2214189A00A12191 /* SetViewController.h */, 208 | 83A0100F2214189A00A12191 /* SetViewController.m */, 209 | ); 210 | path = Bussiness; 211 | sourceTree = ""; 212 | }; 213 | 8A2D7A747B93FA7CB090862D /* Frameworks */ = { 214 | isa = PBXGroup; 215 | children = ( 216 | 098C7D922B51540EF2379631 /* libPods-WKAppDelegate-demo.a */, 217 | ); 218 | name = Frameworks; 219 | sourceTree = ""; 220 | }; 221 | 9D0BEFA860CFB5E7E9415BF2 /* Pods */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | C8DB89397148A3D0A5BB66A8 /* Pods-WKAppDelegate-demo.debug.xcconfig */, 225 | D3875AB90B1FB313E3327EF5 /* Pods-WKAppDelegate-demo.release.xcconfig */, 226 | ); 227 | path = Pods; 228 | sourceTree = ""; 229 | }; 230 | /* End PBXGroup section */ 231 | 232 | /* Begin PBXNativeTarget section */ 233 | 83A00FB822129F7600A12191 /* WKAppDelegate-demo */ = { 234 | isa = PBXNativeTarget; 235 | buildConfigurationList = 83A00FCF22129F7800A12191 /* Build configuration list for PBXNativeTarget "WKAppDelegate-demo" */; 236 | buildPhases = ( 237 | 476A462DB023C64EA1C3A48B /* [CP] Check Pods Manifest.lock */, 238 | 83A00FB522129F7600A12191 /* Sources */, 239 | 83A00FB622129F7600A12191 /* Frameworks */, 240 | 83A00FB722129F7600A12191 /* Resources */, 241 | ); 242 | buildRules = ( 243 | ); 244 | dependencies = ( 245 | ); 246 | name = "WKAppDelegate-demo"; 247 | productName = APPEventModule; 248 | productReference = 83A00FB922129F7600A12191 /* WKAppDelegate-demo.app */; 249 | productType = "com.apple.product-type.application"; 250 | }; 251 | /* End PBXNativeTarget section */ 252 | 253 | /* Begin PBXProject section */ 254 | 83A00FB122129F7600A12191 /* Project object */ = { 255 | isa = PBXProject; 256 | attributes = { 257 | LastUpgradeCheck = 1000; 258 | ORGANIZATIONNAME = "王凯"; 259 | TargetAttributes = { 260 | 83A00FB822129F7600A12191 = { 261 | CreatedOnToolsVersion = 10.0; 262 | }; 263 | }; 264 | }; 265 | buildConfigurationList = 83A00FB422129F7600A12191 /* Build configuration list for PBXProject "WKAppDelegate-demo" */; 266 | compatibilityVersion = "Xcode 9.3"; 267 | developmentRegion = en; 268 | hasScannedForEncodings = 0; 269 | knownRegions = ( 270 | en, 271 | Base, 272 | ); 273 | mainGroup = 83A00FB022129F7600A12191; 274 | productRefGroup = 83A00FBA22129F7600A12191 /* Products */; 275 | projectDirPath = ""; 276 | projectRoot = ""; 277 | targets = ( 278 | 83A00FB822129F7600A12191 /* WKAppDelegate-demo */, 279 | ); 280 | }; 281 | /* End PBXProject section */ 282 | 283 | /* Begin PBXResourcesBuildPhase section */ 284 | 83A00FB722129F7600A12191 /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 83A00FC922129F7800A12191 /* LaunchScreen.storyboard in Resources */, 289 | 83A00FC622129F7800A12191 /* Assets.xcassets in Resources */, 290 | 83A00FC422129F7600A12191 /* Main.storyboard in Resources */, 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | }; 294 | /* End PBXResourcesBuildPhase section */ 295 | 296 | /* Begin PBXShellScriptBuildPhase section */ 297 | 476A462DB023C64EA1C3A48B /* [CP] Check Pods Manifest.lock */ = { 298 | isa = PBXShellScriptBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | ); 302 | inputFileListPaths = ( 303 | ); 304 | inputPaths = ( 305 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 306 | "${PODS_ROOT}/Manifest.lock", 307 | ); 308 | name = "[CP] Check Pods Manifest.lock"; 309 | outputFileListPaths = ( 310 | ); 311 | outputPaths = ( 312 | "$(DERIVED_FILE_DIR)/Pods-WKAppDelegate-demo-checkManifestLockResult.txt", 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | shellPath = /bin/sh; 316 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 317 | showEnvVarsInLog = 0; 318 | }; 319 | /* End PBXShellScriptBuildPhase section */ 320 | 321 | /* Begin PBXSourcesBuildPhase section */ 322 | 83A00FB522129F7600A12191 /* Sources */ = { 323 | isa = PBXSourcesBuildPhase; 324 | buildActionMask = 2147483647; 325 | files = ( 326 | 83A00FCC22129F7800A12191 /* main.m in Sources */, 327 | 83A00FE32212B34D00A12191 /* testMudule.m in Sources */, 328 | 83A00FE92212C39300A12191 /* MainViewController.m in Sources */, 329 | 0A7648E0232F3ABF006C6FFA /* WKAppDelegate.m in Sources */, 330 | 83A01003221417BD00A12191 /* BaseToolbar.m in Sources */, 331 | 0A7648DD232F3ABF006C6FFA /* WKAppEventModuleManager.m in Sources */, 332 | 0A7648DF232F3ABF006C6FFA /* WKAppEventAnnotation.m in Sources */, 333 | 83A01001221417BD00A12191 /* MainToolbar.m in Sources */, 334 | 83A010102214189A00A12191 /* SetViewController.m in Sources */, 335 | 83A0100D2214188F00A12191 /* ComponentController.m in Sources */, 336 | 83A00FEC2214045400A12191 /* MainView.m in Sources */, 337 | 83A010072214185F00A12191 /* HomeController.m in Sources */, 338 | 83A0100A2214187000A12191 /* MyViewController.m in Sources */, 339 | 0A8B04952282CADA00A7EB06 /* testRemoteNotificationModule.m in Sources */, 340 | 83A00FE62212C16200A12191 /* testLowLevelModule.m in Sources */, 341 | 0A7648DC232F3ABF006C6FFA /* NSObject+AppEventModule.m in Sources */, 342 | 83A00FBE22129F7600A12191 /* AppDelegate.m in Sources */, 343 | 83A01002221417BD00A12191 /* BaseButton.m in Sources */, 344 | 0A7648DE232F3ABF006C6FFA /* WKBaseAppEventModule.m in Sources */, 345 | ); 346 | runOnlyForDeploymentPostprocessing = 0; 347 | }; 348 | /* End PBXSourcesBuildPhase section */ 349 | 350 | /* Begin PBXVariantGroup section */ 351 | 83A00FC222129F7600A12191 /* Main.storyboard */ = { 352 | isa = PBXVariantGroup; 353 | children = ( 354 | 83A00FC322129F7600A12191 /* Base */, 355 | ); 356 | name = Main.storyboard; 357 | sourceTree = ""; 358 | }; 359 | 83A00FC722129F7800A12191 /* LaunchScreen.storyboard */ = { 360 | isa = PBXVariantGroup; 361 | children = ( 362 | 83A00FC822129F7800A12191 /* Base */, 363 | ); 364 | name = LaunchScreen.storyboard; 365 | sourceTree = ""; 366 | }; 367 | /* End PBXVariantGroup section */ 368 | 369 | /* Begin XCBuildConfiguration section */ 370 | 83A00FCD22129F7800A12191 /* Debug */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | ALWAYS_SEARCH_USER_PATHS = NO; 374 | CLANG_ANALYZER_NONNULL = YES; 375 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 376 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 377 | CLANG_CXX_LIBRARY = "libc++"; 378 | CLANG_ENABLE_MODULES = YES; 379 | CLANG_ENABLE_OBJC_ARC = YES; 380 | CLANG_ENABLE_OBJC_WEAK = YES; 381 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_COMMA = YES; 384 | CLANG_WARN_CONSTANT_CONVERSION = YES; 385 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 388 | CLANG_WARN_EMPTY_BODY = YES; 389 | CLANG_WARN_ENUM_CONVERSION = YES; 390 | CLANG_WARN_INFINITE_RECURSION = YES; 391 | CLANG_WARN_INT_CONVERSION = YES; 392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 393 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 396 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 397 | CLANG_WARN_STRICT_PROTOTYPES = YES; 398 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 399 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 400 | CLANG_WARN_UNREACHABLE_CODE = YES; 401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 402 | CODE_SIGN_IDENTITY = "iPhone Developer"; 403 | COPY_PHASE_STRIP = NO; 404 | DEBUG_INFORMATION_FORMAT = dwarf; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | ENABLE_TESTABILITY = YES; 407 | GCC_C_LANGUAGE_STANDARD = gnu11; 408 | GCC_DYNAMIC_NO_PIC = NO; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_OPTIMIZATION_LEVEL = 0; 411 | GCC_PREPROCESSOR_DEFINITIONS = ( 412 | "DEBUG=1", 413 | "$(inherited)", 414 | ); 415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 417 | GCC_WARN_UNDECLARED_SELECTOR = YES; 418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 419 | GCC_WARN_UNUSED_FUNCTION = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 422 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 423 | MTL_FAST_MATH = YES; 424 | ONLY_ACTIVE_ARCH = YES; 425 | SDKROOT = iphoneos; 426 | }; 427 | name = Debug; 428 | }; 429 | 83A00FCE22129F7800A12191 /* Release */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ALWAYS_SEARCH_USER_PATHS = NO; 433 | CLANG_ANALYZER_NONNULL = YES; 434 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 435 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 436 | CLANG_CXX_LIBRARY = "libc++"; 437 | CLANG_ENABLE_MODULES = YES; 438 | CLANG_ENABLE_OBJC_ARC = YES; 439 | CLANG_ENABLE_OBJC_WEAK = YES; 440 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 441 | CLANG_WARN_BOOL_CONVERSION = YES; 442 | CLANG_WARN_COMMA = YES; 443 | CLANG_WARN_CONSTANT_CONVERSION = YES; 444 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 445 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 446 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INFINITE_RECURSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 453 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 455 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 456 | CLANG_WARN_STRICT_PROTOTYPES = YES; 457 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 458 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 459 | CLANG_WARN_UNREACHABLE_CODE = YES; 460 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 461 | CODE_SIGN_IDENTITY = "iPhone Developer"; 462 | COPY_PHASE_STRIP = NO; 463 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 464 | ENABLE_NS_ASSERTIONS = NO; 465 | ENABLE_STRICT_OBJC_MSGSEND = YES; 466 | GCC_C_LANGUAGE_STANDARD = gnu11; 467 | GCC_NO_COMMON_BLOCKS = YES; 468 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 469 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 470 | GCC_WARN_UNDECLARED_SELECTOR = YES; 471 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 472 | GCC_WARN_UNUSED_FUNCTION = YES; 473 | GCC_WARN_UNUSED_VARIABLE = YES; 474 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 475 | MTL_ENABLE_DEBUG_INFO = NO; 476 | MTL_FAST_MATH = YES; 477 | SDKROOT = iphoneos; 478 | VALIDATE_PRODUCT = YES; 479 | }; 480 | name = Release; 481 | }; 482 | 83A00FD022129F7800A12191 /* Debug */ = { 483 | isa = XCBuildConfiguration; 484 | baseConfigurationReference = C8DB89397148A3D0A5BB66A8 /* Pods-WKAppDelegate-demo.debug.xcconfig */; 485 | buildSettings = { 486 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 487 | CODE_SIGN_STYLE = Automatic; 488 | DEVELOPMENT_TEAM = 929467FPP6; 489 | INFOPLIST_FILE = "WKAppDelegate-demo/Info.plist"; 490 | LD_RUNPATH_SEARCH_PATHS = ( 491 | "$(inherited)", 492 | "@executable_path/Frameworks", 493 | ); 494 | PRODUCT_BUNDLE_IDENTIFIER = "com.wangkai.responder.SHRMAppDelegate-demo"; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | TARGETED_DEVICE_FAMILY = "1,2"; 497 | }; 498 | name = Debug; 499 | }; 500 | 83A00FD122129F7800A12191 /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | baseConfigurationReference = D3875AB90B1FB313E3327EF5 /* Pods-WKAppDelegate-demo.release.xcconfig */; 503 | buildSettings = { 504 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 505 | CODE_SIGN_STYLE = Automatic; 506 | DEVELOPMENT_TEAM = 929467FPP6; 507 | INFOPLIST_FILE = "WKAppDelegate-demo/Info.plist"; 508 | LD_RUNPATH_SEARCH_PATHS = ( 509 | "$(inherited)", 510 | "@executable_path/Frameworks", 511 | ); 512 | PRODUCT_BUNDLE_IDENTIFIER = "com.wangkai.responder.SHRMAppDelegate-demo"; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | TARGETED_DEVICE_FAMILY = "1,2"; 515 | }; 516 | name = Release; 517 | }; 518 | /* End XCBuildConfiguration section */ 519 | 520 | /* Begin XCConfigurationList section */ 521 | 83A00FB422129F7600A12191 /* Build configuration list for PBXProject "WKAppDelegate-demo" */ = { 522 | isa = XCConfigurationList; 523 | buildConfigurations = ( 524 | 83A00FCD22129F7800A12191 /* Debug */, 525 | 83A00FCE22129F7800A12191 /* Release */, 526 | ); 527 | defaultConfigurationIsVisible = 0; 528 | defaultConfigurationName = Release; 529 | }; 530 | 83A00FCF22129F7800A12191 /* Build configuration list for PBXNativeTarget "WKAppDelegate-demo" */ = { 531 | isa = XCConfigurationList; 532 | buildConfigurations = ( 533 | 83A00FD022129F7800A12191 /* Debug */, 534 | 83A00FD122129F7800A12191 /* Release */, 535 | ); 536 | defaultConfigurationIsVisible = 0; 537 | defaultConfigurationName = Release; 538 | }; 539 | /* End XCConfigurationList section */ 540 | }; 541 | rootObject = 83A00FB122129F7600A12191 /* Project object */; 542 | } 543 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/APPEventModule/testLowLevelModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // testLowLevelModule.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBaseAppEventModule.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface testLowLevelModule : WKBaseAppEventModule 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/APPEventModule/testLowLevelModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // testLowLevelModule.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "testLowLevelModule.h" 10 | 11 | WKAppEventMod(testLowLevelModule) 12 | 13 | @implementation testLowLevelModule 14 | 15 | - (NSInteger)moduleLevel { 16 | return 2; 17 | } 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | [self initMudule]; 21 | [self destroyModule]; 22 | return YES; 23 | } 24 | 25 | - (void)initMudule { 26 | NSLog(@"%@ init", NSStringFromClass([self class])); 27 | } 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/APPEventModule/testMudule.h: -------------------------------------------------------------------------------- 1 | // 2 | // testMudule.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WKBaseAppEventModule.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface testMudule : WKBaseAppEventModule 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/APPEventModule/testMudule.m: -------------------------------------------------------------------------------- 1 | // 2 | // testMudule.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "testMudule.h" 10 | 11 | WKAppEventMod(testMudule) 12 | 13 | @implementation testMudule 14 | 15 | - (NSInteger)moduleLevel { 16 | return 1; 17 | } 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | [self initMudule]; 21 | [self destroyModule]; 22 | return YES; 23 | } 24 | 25 | - (void)initMudule { 26 | NSLog(@"testMudule init"); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/APPEventModule/testRemoteNotificationModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // testRemoteNotificationModule.h 3 | // WKAppDelegate-demo 4 | // 5 | // Created by Kevin on 2019/5/8. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBaseAppEventModule.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface testRemoteNotificationModule : WKBaseAppEventModule 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/APPEventModule/testRemoteNotificationModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // testRemoteNotificationModule.m 3 | // WKAppDelegate-demo 4 | // 5 | // Created by Kevin on 2019/5/8. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "testRemoteNotificationModule.h" 10 | 11 | WKAppEventMod(testRemoteNotificationModule) 12 | 13 | @implementation testRemoteNotificationModule 14 | 15 | - (NSInteger)moduleLevel { 16 | return 3; 17 | } 18 | 19 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { 20 | 21 | [UIApplication sharedApplication].applicationIconBadgeNumber = 0; 22 | 23 | [self performSelector:@selector(handleNotification:) 24 | withObject:userInfo 25 | afterDelay:0.3]; 26 | completionHandler(UIBackgroundFetchResultNewData); 27 | } 28 | 29 | - (void)handleNotification:(NSDictionary *)userInfo { 30 | //处理推送 消息 31 | NSString *payloadStr = userInfo[@"userInfo"]; 32 | NSLog(@"%@",payloadStr); 33 | [[NSNotificationCenter defaultCenter] postNotificationName:@"REMOTE_NOTIFICATION" 34 | object:nil 35 | userInfo:userInfo]; 36 | } 37 | 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WKAppDelegate.h" 11 | 12 | @interface AppDelegate : WKAppDelegate 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MainViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | @synthesize window; 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | [super application:application didFinishLaunchingWithOptions:launchOptions]; 22 | [self initMainController]; 23 | return YES; 24 | } 25 | 26 | - (void)initMainController { 27 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 28 | self.window.backgroundColor = [UIColor whiteColor]; 29 | self.window.rootViewController = [[MainViewController alloc] init]; 30 | [self.window makeKeyAndVisible]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/account_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "account_nor@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/account_nor.imageset/account_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/account_nor.imageset/account_nor@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/account_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "account_sel@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/account_sel.imageset/account_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/account_sel.imageset/account_sel@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/invest_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "invest_nor@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/invest_nor.imageset/invest_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/invest_nor.imageset/invest_nor@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/invest_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "invest_sel@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/invest_sel.imageset/invest_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/invest_sel.imageset/invest_sel@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/register_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "register_nor@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/register_nor.imageset/register_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/register_nor.imageset/register_nor@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/register_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "register_sel@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/register_sel.imageset/register_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/register_sel.imageset/register_sel@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/setting_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "setting_nor@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/setting_nor.imageset/setting_nor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/setting_nor.imageset/setting_nor@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/setting_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "setting_sel@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/setting_sel.imageset/setting_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKAppDelegate/958ce8611cce7d1d067c0033dd113891523f946b/WKAppDelegate-demo/WKAppDelegate-demo/Assets.xcassets/toolbar/setting_sel.imageset/setting_sel@2x.png -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/ComponentController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ComponentController.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ComponentController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/ComponentController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ComponentController.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "ComponentController.h" 10 | 11 | @interface ComponentController () 12 | 13 | @end 14 | 15 | @implementation ComponentController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.view.backgroundColor = [UIColor blackColor]; 21 | } 22 | 23 | /* 24 | #pragma mark - Navigation 25 | 26 | // In a storyboard-based application, you will often want to do a little preparation before navigation 27 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 28 | // Get the new view controller using [segue destinationViewController]. 29 | // Pass the selected object to the new view controller. 30 | } 31 | */ 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/HomeController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeController.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HomeController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/HomeController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeController.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "HomeController.h" 10 | 11 | @interface HomeController () 12 | 13 | @end 14 | 15 | @implementation HomeController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.view.backgroundColor = [UIColor blueColor]; 21 | self.title = @"首页"; 22 | } 23 | 24 | /* 25 | #pragma mark - Navigation 26 | 27 | // In a storyboard-based application, you will often want to do a little preparation before navigation 28 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 29 | // Get the new view controller using [segue destinationViewController]. 30 | // Pass the selected object to the new view controller. 31 | } 32 | */ 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/MyViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyViewController.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface MyViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/MyViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MyViewController.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "MyViewController.h" 10 | 11 | @interface MyViewController () 12 | 13 | @end 14 | 15 | @implementation MyViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.view.backgroundColor = [UIColor yellowColor]; 21 | } 22 | 23 | /* 24 | #pragma mark - Navigation 25 | 26 | // In a storyboard-based application, you will often want to do a little preparation before navigation 27 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 28 | // Get the new view controller using [segue destinationViewController]. 29 | // Pass the selected object to the new view controller. 30 | } 31 | */ 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/SetViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SetViewController.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SetViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Bussiness/SetViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SetViewController.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "SetViewController.h" 10 | 11 | @interface SetViewController () 12 | 13 | @end 14 | 15 | @implementation SetViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.view.backgroundColor = [UIColor grayColor]; 21 | } 22 | 23 | /* 24 | #pragma mark - Navigation 25 | 26 | // In a storyboard-based application, you will often want to do a little preparation before navigation 27 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 28 | // Get the new view controller using [segue destinationViewController]. 29 | // Pass the selected object to the new view controller. 30 | } 31 | */ 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Common/UI/Toolbar/BaseButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseButton.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | /** 13 | 功能:可以便捷的设置按钮的可视区域 14 | 使用场景:按钮的可视区域小于触控区域 15 | 用法:触控区由setFrame:设定,可视区域通过接口setContentArea:设置. 16 | */ 17 | @interface BaseButton : UIButton 18 | /** 19 | * 相对于button的bounds,设置可视区域 20 | * 21 | * @param areaRect 相对于bounds的可视区域 22 | */ 23 | - (void)setContentArea:(CGRect)areaRect; 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Common/UI/Toolbar/BaseButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseButton.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "BaseButton.h" 10 | 11 | @interface BaseButton () 12 | { 13 | CGRect contentRect; 14 | } 15 | @end 16 | 17 | @implementation BaseButton 18 | 19 | - (id)initWithFrame:(CGRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | { 23 | if (self) 24 | { 25 | contentRect = CGRectZero; 26 | #ifdef UICONTROLAREA 27 | self.backgroundColor = [UIColor yellowColor]; 28 | #endif 29 | } 30 | } 31 | return self; 32 | } 33 | 34 | + (id)buttonWithType:(UIButtonType)buttonType 35 | { 36 | id tmp = [super buttonWithType:buttonType]; 37 | #ifdef UICONTROLAREA 38 | [(UIButton *)tmp setBackgroundColor:[UIColor yellowColor]]; 39 | #endif 40 | return tmp; 41 | } 42 | 43 | - (void)setContentArea:(CGRect)areaRect 44 | { 45 | contentRect = areaRect; 46 | } 47 | 48 | - (CGRect)backgroundRectForBounds:(CGRect)bounds 49 | { 50 | if (CGRectIsEmpty(contentRect)) 51 | { 52 | return bounds; 53 | } 54 | else 55 | { 56 | return contentRect; 57 | } 58 | } 59 | 60 | - (CGRect)contentRectForBounds:(CGRect)bounds 61 | { 62 | if (CGRectIsEmpty(contentRect)) 63 | { 64 | return bounds; 65 | } 66 | else 67 | { 68 | return contentRect; 69 | } 70 | } 71 | 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Common/UI/Toolbar/BaseToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseToolbar.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface BaseToolbar : UIView 14 | @property (nonatomic, strong) NSArray *items; 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Common/UI/Toolbar/BaseToolbar.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseToolbar.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "BaseToolbar.h" 10 | #import "UIConfigDefine.h" 11 | 12 | #define ToolbarItemGap 6 13 | 14 | @implementation BaseToolbar 15 | 16 | - (instancetype)initWithFrame:(CGRect)frame 17 | { 18 | self = [super initWithFrame:frame]; 19 | if (self) { 20 | self.backgroundColor = UIColorFromRGBAValue(0x0e, 0x17, 0x31, 0.85); 21 | } 22 | return self; 23 | } 24 | 25 | 26 | - (void)setItems:(NSArray *)aItems 27 | { 28 | [aItems count]; 29 | NSArray *tmpItems = [[NSArray alloc] initWithArray:aItems]; 30 | [tmpItems enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 31 | 32 | UIView *tmpItem = (UIView *)obj; 33 | CGRect itemFrame = [self getItemFrame:idx 34 | count:[aItems count] 35 | frame:tmpItem.frame]; 36 | tmpItem.frame = itemFrame; 37 | [self addSubview:tmpItem]; 38 | }]; 39 | } 40 | 41 | - (CGRect)getItemFrame:(NSUInteger)aIndex count:(NSUInteger)aCount frame:(CGRect)aFrame 42 | { 43 | CGRect itemFrame = CGRectZero; 44 | CGFloat itemWidth = (ScreenWidth - (aCount + 1) * ToolbarItemGap) / aCount; 45 | itemFrame.size.height = aFrame.size.height; 46 | itemFrame.origin.y = (TOOLBAR_BASICHEIGHT - aFrame.size.height) / 2.0; 47 | if (aFrame.size.width < itemWidth) 48 | { 49 | itemFrame.size.width = aFrame.size.width; 50 | itemFrame.origin.x = aIndex * aFrame.size.width + (aIndex + 1) * (ScreenWidth - aCount * aFrame.size.width) / (aCount + 1); 51 | } 52 | else 53 | { 54 | itemFrame.size.width = itemWidth; 55 | itemFrame.origin.x = aIndex * itemWidth + (aIndex + 1) * ToolbarItemGap; 56 | } 57 | return itemFrame; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Common/UI/Toolbar/MainToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainToolbar.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "BaseToolbar.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol MainToolbarDelegate 14 | 15 | - (void)toolbarButtonClick:(id)sender; 16 | 17 | @end 18 | 19 | @interface MainToolbar : BaseToolbar 20 | @property (nonatomic, weak) id toolbarDelegate; 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Common/UI/Toolbar/MainToolbar.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainToolbar.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "MainToolbar.h" 10 | #import "BaseButton.h" 11 | #import "UIConfigDefine.h" 12 | 13 | @interface MainToolbar () 14 | @property (nonatomic, strong) BaseButton *focusButton; 15 | 16 | - (void)initViews; 17 | - (void)onToolbarButtonClick:(id)sender; 18 | @end 19 | 20 | @implementation MainToolbar 21 | 22 | - (id)initWithFrame:(CGRect)frame 23 | { 24 | if (self = [super initWithFrame:frame]) 25 | { 26 | self.backgroundColor = UIColorFromRGBAValue(0x0e, 0x17, 0x31, 0.85); 27 | [self initViews]; 28 | } 29 | return self; 30 | } 31 | 32 | - (void)initViews 33 | { 34 | CGRect toolbarButtonFrame = CGRectMake(0, 0, 80, 48); 35 | BaseButton *firstButton = [BaseButton buttonWithType:UIButtonTypeCustom]; 36 | firstButton.frame = toolbarButtonFrame; 37 | [firstButton setImage:[UIImage imageNamed:@"invest_nor"] 38 | forState:UIControlStateNormal]; 39 | [firstButton setImage:[UIImage imageNamed:@"invest_sel"] 40 | forState:UIControlStateSelected]; 41 | firstButton.tag = TOOLBAR_TAG_FIRST; 42 | [firstButton addTarget:self 43 | action:@selector(onToolbarButtonClick:) 44 | forControlEvents:UIControlEventTouchDown]; 45 | 46 | BaseButton *secondButton = [BaseButton buttonWithType:UIButtonTypeCustom]; 47 | secondButton.frame = toolbarButtonFrame; 48 | [secondButton setImage:[UIImage imageNamed:@"account_nor"] 49 | forState:UIControlStateNormal]; 50 | [secondButton setImage:[UIImage imageNamed:@"account_sel"] 51 | forState:UIControlStateSelected]; 52 | secondButton.tag = TOOLBAR_TAG_SECOND; 53 | [secondButton addTarget:self 54 | action:@selector(onToolbarButtonClick:) 55 | forControlEvents:UIControlEventTouchDown]; 56 | 57 | BaseButton * thirdButton = [BaseButton buttonWithType:UIButtonTypeCustom]; 58 | thirdButton.frame = toolbarButtonFrame; 59 | [thirdButton setImage:[UIImage imageNamed:@"register_nor"] 60 | forState:UIControlStateNormal]; 61 | [thirdButton setImage:[UIImage imageNamed:@"register_sel"] 62 | forState:UIControlStateSelected]; 63 | thirdButton.tag = TOOLBAR_TAG_THIRD; 64 | [thirdButton addTarget:self 65 | action:@selector(onToolbarButtonClick:) 66 | forControlEvents:UIControlEventTouchDown]; 67 | 68 | BaseButton * fourthButton = [BaseButton buttonWithType:UIButtonTypeCustom]; 69 | fourthButton.frame = toolbarButtonFrame; 70 | [fourthButton setImage:[UIImage imageNamed:@"setting_nor"] 71 | forState:UIControlStateNormal]; 72 | [fourthButton setImage:[UIImage imageNamed:@"setting_sel"] 73 | forState:UIControlStateSelected]; 74 | fourthButton.tag = TOOLBAR_TAG_FOURTH; 75 | [fourthButton addTarget:self 76 | action:@selector(onToolbarButtonClick:) 77 | forControlEvents:UIControlEventTouchDown]; 78 | 79 | NSArray* itemArray = @[firstButton, secondButton, thirdButton, fourthButton]; 80 | 81 | self.items = itemArray; 82 | 83 | // switch ([FireflyGlobalVar sharedInstance].launchPage) { 84 | // case 0: 85 | // firstButton.selected = YES; 86 | // self.focusButton = firstButton; 87 | // break; 88 | // case 1: 89 | // secondButton.selected = YES; 90 | // self.focusButton = secondButton; 91 | // break; 92 | // case 2: 93 | // thirdButton.selected = YES; 94 | // self.focusButton = thirdButton; 95 | // break; 96 | // case 3: 97 | // fourthButton.selected = YES; 98 | // self.focusButton = fourthButton; 99 | // break; 100 | // default: 101 | // break; 102 | // } 103 | } 104 | 105 | - (void)onToolbarButtonClick:(id)sender 106 | { 107 | BaseButton *button = (BaseButton *)sender; 108 | if (button.tag != self.focusButton.tag) 109 | { 110 | self.focusButton.selected = NO; 111 | button.selected = YES; 112 | self.focusButton = button; 113 | 114 | if (self.toolbarDelegate && [self.toolbarDelegate respondsToSelector:@selector(toolbarButtonClick:)]) 115 | { 116 | [self.toolbarDelegate toolbarButtonClick:sender]; 117 | } 118 | } 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Common/UI/UIConfigDefine.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIConfigDefine.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #ifndef UIConfigDefine_h 10 | #define UIConfigDefine_h 11 | 12 | #define UIColorFromRGBAValue(R,G,B,A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A] 13 | #define VIEWCONTROLLERBACKGROUNDCOLOR UIColorFromHexValue(0xf5f7fb) 14 | 15 | typedef NS_ENUM(NSInteger, TestToolbarTag) 16 | { 17 | TOOLBAR_TAG_FIRST = 0x0001000, 18 | TOOLBAR_TAG_SECOND, 19 | TOOLBAR_TAG_THIRD, 20 | TOOLBAR_TAG_FOURTH, 21 | }; 22 | 23 | // 判断设备是否为Plus系列分辨率 24 | #define IS_SCREEN_55_INCH ([UIScreen mainScreen].bounds.size.width == 414 && [UIScreen mainScreen].bounds.size.height == 736) 25 | // 判断设备是否为iPhone6系列分辨率 26 | #define IS_SCREEN_47_INCH ([UIScreen mainScreen].bounds.size.width == 375 && [UIScreen mainScreen].bounds.size.height == 667) 27 | // 判断设备是否为iPhone5系列分辨率 28 | #define IS_SCREEN_4_INCH ([UIScreen mainScreen].bounds.size.width == 320 && [UIScreen mainScreen].bounds.size.height == 568) 29 | // 判断设备是否为iPhone4系列分辨率 30 | #define IS_SCREEN_35_INCH ([UIScreen mainScreen].bounds.size.width == 320 && [UIScreen mainScreen].bounds.size.height == 480) 31 | // 判断设备是否为X或XS分辨率 32 | #define IS_iPhoneX ([UIScreen mainScreen].bounds.size.width == 375 && [UIScreen mainScreen].bounds.size.height == 812) 33 | // 判断设备是否为MAX或XR分辨率 34 | #define IS_iPhoneMAX_OR_XR ([UIScreen mainScreen].bounds.size.width == 414 && [UIScreen mainScreen].bounds.size.height == 896) 35 | // 判断设备是否有刘海 36 | #define IS_FringeScreen ((IS_iPhoneX) || (IS_iPhoneMAX_OR_XR)) 37 | 38 | #define STATUS_GAP (IS_FringeScreen? 44 : 20) 39 | 40 | #define iPhoneXSafeBottomMargin (IS_FringeScreen ? 34.f : 0.f) 41 | 42 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 43 | #define ScreenHeight (IOS7_OR_LATER? [UIScreen mainScreen].bounds.size.height:([UIScreen mainScreen].bounds.size.height - STATUS_GAP)) 44 | 45 | 46 | #define NAV_BAR_HEIGHT 44 47 | #define NAV_BAR_FRAME (IOS7_OR_LATER? CGRectMake(0, 0, ScreenWidth, NAV_BAR_HEIGHT + STATUS_GAP):CGRectMake(0, 0, ScreenWidth, NAV_BAR_HEIGHT)) 48 | 49 | #define TOOLBAR_BASICHEIGHT 48 50 | #define TOOLBAR_HEIGHT (TOOLBAR_BASICHEIGHT + iPhoneXSafeBottomMargin) 51 | #define SCROLLVIEW_GAP 20 52 | 53 | #define IOS12_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"12.0" options:NSNumericSearch] != NSOrderedAscending ) 54 | #define IOS11_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"11.0" options:NSNumericSearch] != NSOrderedAscending ) 55 | #define IOS10_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"10.0" options:NSNumericSearch] != NSOrderedAscending ) 56 | #define IOS9_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"9.0" options:NSNumericSearch] != NSOrderedAscending ) 57 | #define IOS8_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] != NSOrderedAscending ) 58 | #define IOS7_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending ) 59 | #define IOS6_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"6.0" options:NSNumericSearch] != NSOrderedAscending ) 60 | #define IOS5_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"5.0" options:NSNumericSearch] != NSOrderedAscending ) 61 | #define IOS4_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"4.0" options:NSNumericSearch] != NSOrderedAscending ) 62 | #define IOS3_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"3.0" options:NSNumericSearch] != NSOrderedAscending ) 63 | 64 | 65 | #endif /* UIConfigDefine_h */ 66 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/MainView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainView.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MainToolbar.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface MainView : UIView 15 | @property (nonatomic, strong) MainToolbar *mainToolbar; 16 | 17 | - (id)initWithFrame:(CGRect)frame toolbarDelegate:(id)aDelegate; 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/MainView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainView.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/13. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "MainView.h" 10 | #import "UIConfigDefine.h" 11 | 12 | @implementation MainView 13 | 14 | - (id)initWithFrame:(CGRect)frame toolbarDelegate:(id)aDelegate 15 | { 16 | if (self = [super initWithFrame:frame]) 17 | { 18 | self.backgroundColor = [UIColor redColor]; 19 | CGRect toolbarFrame = CGRectMake(0, frame.size.height - TOOLBAR_HEIGHT, frame.size.width, TOOLBAR_HEIGHT); 20 | MainToolbar *toolbar = [[MainToolbar alloc] initWithFrame:toolbarFrame]; 21 | // toolbar.delegate = aDelegate; 22 | toolbar.toolbarDelegate = aDelegate; 23 | self.mainToolbar = toolbar; 24 | [self addSubview:toolbar]; 25 | } 26 | return self; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface MainViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "MainViewController.h" 10 | #import "UIConfigDefine.h" 11 | #import "MainView.h" 12 | #import "HomeController.h" 13 | #import "MyViewController.h" 14 | #import "ComponentController.h" 15 | #import "SetViewController.h" 16 | #import "BaseButton.h" 17 | 18 | @interface MainViewController () 19 | @property (nonatomic, strong) MainView *mainView; 20 | @property (nonatomic, strong) UIView *focusView; 21 | @property (nonatomic, strong) HomeController *homeController; 22 | @property (nonatomic, strong) MyViewController *myController; 23 | @property (nonatomic, strong) ComponentController *componentController; 24 | @property (nonatomic, strong) SetViewController *setController; 25 | @end 26 | 27 | @implementation MainViewController 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | [self initMainView]; 32 | } 33 | 34 | - (void)initMainView { 35 | self.mainView = [[MainView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-64) 36 | toolbarDelegate:(id)self]; 37 | [self.view addSubview:self.mainView]; 38 | 39 | HomeController *homeController = [[HomeController alloc] init]; 40 | self.homeController = homeController; 41 | [self addChildViewController:self.homeController]; 42 | 43 | MyViewController *myController = [[MyViewController alloc] init]; 44 | self.myController = myController; 45 | [self addChildViewController:self.myController]; 46 | 47 | ComponentController *componentController = [[ComponentController alloc] init]; 48 | self.componentController = componentController; 49 | [self addChildViewController:self.componentController]; 50 | 51 | SetViewController *setController = [[SetViewController alloc] init]; 52 | self.setController = setController; 53 | [self addChildViewController:self.setController]; 54 | 55 | self.focusView = self.homeController.view; 56 | [self.mainView insertSubview:self.focusView 57 | belowSubview:self.mainView.mainToolbar]; 58 | } 59 | 60 | #pragma mark - MainToolbarDelegate 61 | - (void)toolbarButtonClick:(id)sender 62 | { 63 | BaseButton *button = (BaseButton *)sender; 64 | [self.focusView removeFromSuperview]; 65 | 66 | switch (button.tag) 67 | { 68 | case TOOLBAR_TAG_FIRST: 69 | { 70 | self.focusView = self.homeController.view; 71 | } 72 | break; 73 | case TOOLBAR_TAG_SECOND: 74 | { 75 | self.focusView = self.myController.view; 76 | // [self.testRYBViewController recoverBusinessData]; 77 | } 78 | break; 79 | case TOOLBAR_TAG_THIRD: 80 | { 81 | self.focusView = self.componentController.view; 82 | // [self.testJSWebviewController reloadPage]; 83 | } 84 | break; 85 | case TOOLBAR_TAG_FOURTH: 86 | { 87 | self.focusView = self.setController.view; 88 | } 89 | break; 90 | default: 91 | break; 92 | } 93 | 94 | [self.mainView addSubview:self.focusView]; 95 | [self.mainView insertSubview:self.focusView 96 | belowSubview:self.mainView.mainToolbar]; 97 | } 98 | 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/NSObject+AppEventModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AppEventModule.h 3 | // Pods-WKAppDelegate-demo 4 | // 5 | // Created by Kevin on 2019/5/8. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface NSObject (AppEventModule) 13 | 14 | - (id)performSelector:(SEL)selector 15 | withObject:(id)p1 16 | withObject:(id)p2 17 | withObject:(id)p3; 18 | 19 | - (id)performSelector:(SEL)selector 20 | withObject:(id)p1 21 | withObject:(id)p2 22 | withObject:(id)p3 23 | withObject:(id)p4; 24 | 25 | - (id)performSelector:(SEL)selector 26 | withObject:(id)p1 27 | withObject:(id)p2 28 | withObject:(id)p3 29 | withObject:(id)p4 30 | withObject:(id)p5; 31 | 32 | - (id)performSelector:(SEL)selector 33 | withObject:(id)p1 34 | withObject:(id)p2 35 | withObject:(id)p3 36 | withObject:(id)p4 37 | withObject:(id)p5 38 | withObject:(id)p6; 39 | 40 | - (id)performSelector:(SEL)selector 41 | withObject:(id)p1 42 | withObject:(id)p2 43 | withObject:(id)p3 44 | withObject:(id)p4 45 | withObject:(id)p5 46 | withObject:(id)p6 47 | withObject:(id)p7; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/NSObject+AppEventModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AppEventModule.m 3 | // Pods-WKAppDelegate-demo 4 | // 5 | // Created by Kevin on 2019/5/8. 6 | // 7 | 8 | #import "NSObject+AppEventModule.h" 9 | 10 | @implementation NSObject (AppEventModule) 11 | 12 | - (id)performSelector:(SEL)selector 13 | withObject:(id)p1 14 | withObject:(id)p2 15 | withObject:(id)p3 { 16 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 17 | if (sig) { 18 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 19 | [invo setTarget:self]; 20 | [invo setSelector:selector]; 21 | [invo setArgument:&p1 atIndex:2]; 22 | [invo setArgument:&p2 atIndex:3]; 23 | [invo setArgument:&p3 atIndex:4]; 24 | [invo invoke]; 25 | if (sig.methodReturnLength) { 26 | return [self handleReturnType:sig invo:invo]; 27 | } else { 28 | return nil; 29 | } 30 | } else { 31 | return nil; 32 | } 33 | } 34 | 35 | - (id)performSelector:(SEL)selector 36 | withObject:(id)p1 37 | withObject:(id)p2 38 | withObject:(id)p3 39 | withObject:(id)p4 { 40 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 41 | if (sig) { 42 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 43 | [invo setTarget:self]; 44 | [invo setSelector:selector]; 45 | [invo setArgument:&p1 atIndex:2]; 46 | [invo setArgument:&p2 atIndex:3]; 47 | [invo setArgument:&p3 atIndex:4]; 48 | [invo setArgument:&p4 atIndex:5]; 49 | [invo invoke]; 50 | if (sig.methodReturnLength) { 51 | return [self handleReturnType:sig invo:invo]; 52 | } else { 53 | return nil; 54 | } 55 | } else { 56 | return nil; 57 | } 58 | } 59 | 60 | - (id)performSelector:(SEL)selector 61 | withObject:(id)p1 62 | withObject:(id)p2 63 | withObject:(id)p3 64 | withObject:(id)p4 65 | withObject:(id)p5 { 66 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 67 | if (sig) { 68 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 69 | [invo setTarget:self]; 70 | [invo setSelector:selector]; 71 | [invo setArgument:&p1 atIndex:2]; 72 | [invo setArgument:&p2 atIndex:3]; 73 | [invo setArgument:&p3 atIndex:4]; 74 | [invo setArgument:&p4 atIndex:5]; 75 | [invo setArgument:&p5 atIndex:6]; 76 | [invo invoke]; 77 | if (sig.methodReturnLength) { 78 | return [self handleReturnType:sig invo:invo]; 79 | } else { 80 | return nil; 81 | } 82 | } else { 83 | return nil; 84 | } 85 | } 86 | 87 | - (id)performSelector:(SEL)selector 88 | withObject:(id)p1 89 | withObject:(id)p2 90 | withObject:(id)p3 91 | withObject:(id)p4 92 | withObject:(id)p5 93 | withObject:(id)p6 { 94 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 95 | if (sig) { 96 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 97 | [invo setTarget:self]; 98 | [invo setSelector:selector]; 99 | [invo setArgument:&p1 atIndex:2]; 100 | [invo setArgument:&p2 atIndex:3]; 101 | [invo setArgument:&p3 atIndex:4]; 102 | [invo setArgument:&p4 atIndex:5]; 103 | [invo setArgument:&p5 atIndex:6]; 104 | [invo setArgument:&p6 atIndex:7]; 105 | [invo invoke]; 106 | if (sig.methodReturnLength) { 107 | return [self handleReturnType:sig invo:invo]; 108 | } else { 109 | return nil; 110 | } 111 | } else { 112 | return nil; 113 | } 114 | } 115 | 116 | - (id)performSelector:(SEL)selector 117 | withObject:(id)p1 118 | withObject:(id)p2 119 | withObject:(id)p3 120 | withObject:(id)p4 121 | withObject:(id)p5 122 | withObject:(id)p6 123 | withObject:(id)p7 { 124 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 125 | if (sig) { 126 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 127 | [invo setTarget:self]; 128 | [invo setSelector:selector]; 129 | [invo setArgument:&p1 atIndex:2]; 130 | [invo setArgument:&p2 atIndex:3]; 131 | [invo setArgument:&p3 atIndex:4]; 132 | [invo setArgument:&p4 atIndex:5]; 133 | [invo setArgument:&p5 atIndex:6]; 134 | [invo setArgument:&p6 atIndex:7]; 135 | [invo setArgument:&p7 atIndex:8]; 136 | [invo invoke]; 137 | if (sig.methodReturnLength) { 138 | return [self handleReturnType:sig invo:invo]; 139 | } else { 140 | return nil; 141 | } 142 | } else { 143 | return nil; 144 | } 145 | } 146 | 147 | #pragma mark - Private Method 148 | - (id)handleReturnType:(NSMethodSignature *)sig invo:(NSInvocation *)aInvo 149 | { 150 | int booResult = strcmp([sig methodReturnType], @encode(BOOL)); 151 | int floatResult = strcmp([sig methodReturnType], @encode(float)); 152 | int intResult = strcmp([sig methodReturnType], @encode(int)); 153 | 154 | id anObject = nil; 155 | if (booResult == 0) 156 | { 157 | BOOL result; 158 | [aInvo getReturnValue:&result]; 159 | anObject = [NSNumber numberWithBool:result]; 160 | } 161 | else if (floatResult == 0) 162 | { 163 | float result; 164 | [aInvo getReturnValue:&result]; 165 | anObject = [NSNumber numberWithFloat:result]; 166 | } 167 | else if (intResult) 168 | { 169 | int result; 170 | [aInvo getReturnValue:&result]; 171 | anObject = [NSNumber numberWithInt:result]; 172 | } 173 | return anObject; 174 | } 175 | 176 | @end 177 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppDelegate.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface WKAppDelegate : UIResponder 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppDelegate.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKAppDelegate.h" 10 | #import "WKAppEventModuleManager.h" 11 | #import "NSObject+AppEventModule.h" 12 | 13 | @implementation WKAppDelegate 14 | 15 | + (void)load { 16 | [[WKAppEventModuleManager sharedInstance] registedAllModules]; 17 | } 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | 21 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application:didFinishLaunchingWithOptions:) 22 | Complete:^(id _Nonnull module, SEL _Nonnull sel) { 23 | #pragma clang diagnostic push 24 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 25 | [module performSelector:sel 26 | withObject:application 27 | withObject:launchOptions]; 28 | #pragma clang diagnostic pop 29 | }]; 30 | return YES; 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application { 34 | 35 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(applicationDidEnterBackground:) 36 | Complete:^(id _Nonnull module, SEL _Nonnull sel) { 37 | #pragma clang diagnostic push 38 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 39 | [module performSelector:sel 40 | withObject:application]; 41 | #pragma clang diagnostic pop 42 | }]; 43 | } 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application { 46 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(applicationWillEnterForeground:) 47 | Complete:^(id _Nonnull module, SEL _Nonnull sel) { 48 | #pragma clang diagnostic push 49 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 50 | [module performSelector:sel withObject:application]; 51 | #pragma clang diagnostic pop 52 | }]; 53 | } 54 | 55 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler 56 | API_AVAILABLE(ios(7.0)){ 57 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application:didReceiveRemoteNotification:fetchCompletionHandler:) 58 | Complete:^(id module, SEL sel) { 59 | [module performSelector:sel 60 | withObject:application 61 | withObject:userInfo 62 | withObject:completionHandler]; 63 | }]; 64 | } 65 | 66 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 67 | { 68 | __block BOOL result = YES; 69 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application: 70 | openURL: 71 | sourceApplication: 72 | annotation:) 73 | Complete:^(id module, SEL sel) 74 | { 75 | NSNumber *moduleRes = [module performSelector:sel 76 | withObject:application 77 | withObject:url 78 | withObject:sourceApplication 79 | withObject:annotation]; 80 | result = [moduleRes boolValue]; 81 | }]; 82 | 83 | return result; 84 | } 85 | 86 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_8_4 87 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options 88 | { 89 | __block BOOL result = YES; 90 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application: 91 | openURL: 92 | options:) 93 | Complete:^(id module, SEL sel) 94 | { 95 | NSNumber *moduleRes = [module performSelector:sel 96 | withObject:app 97 | withObject:url 98 | withObject:options]; 99 | result = [moduleRes boolValue]; 100 | }]; 101 | 102 | return result; 103 | } 104 | #endif 105 | 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKAppEventAnnotation.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventAnnotation.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef WKAppEventModSectName 12 | #define WKAppEventModSectName "WKAppEventMods" 13 | #endif 14 | 15 | #define WKAppEventDATA(sectname) __attribute((used, section("__DATA,"#sectname" "))) 16 | 17 | #define WKAppEventMod(name) \ 18 | char * k##name##_mod WKAppEventDATA(WKAppEventMods) = ""#name""; 19 | 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface WKAppEventAnnotation : NSObject 24 | 25 | + (NSArray *)AnnotationModules; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKAppEventAnnotation.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventAnnotation.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKAppEventAnnotation.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | static NSArray* FFReadConfiguration(char *section) 16 | { 17 | NSMutableArray *configs = [NSMutableArray array]; 18 | 19 | Dl_info info; 20 | dladdr(FFReadConfiguration, &info); 21 | 22 | #ifndef __LP64__ 23 | // const struct mach_header *mhp = _dyld_get_image_header(0); // both works as below line 24 | const struct mach_header *mhp = (struct mach_header*)info.dli_fbase; 25 | unsigned long size = 0; 26 | uint32_t *memory = (uint32_t*)getsectiondata(mhp, "__DATA", section, & size); 27 | #else /* defined(__LP64__) */ 28 | const struct mach_header_64 *mhp = (struct mach_header_64*)info.dli_fbase; 29 | unsigned long size = 0; 30 | uint64_t *memory = (uint64_t*)getsectiondata(mhp, "__DATA", section, & size); 31 | #endif /* defined(__LP64__) */ 32 | 33 | for(int idx = 0; idx < size/sizeof(void*); ++idx){ 34 | char *string = (char*)memory[idx]; 35 | 36 | NSString *str = [NSString stringWithUTF8String:string]; 37 | if(!str)continue; 38 | 39 | if(str) [configs addObject:str]; 40 | } 41 | 42 | return configs; 43 | 44 | } 45 | 46 | @implementation WKAppEventAnnotation 47 | 48 | + (NSArray *)AnnotationModules 49 | { 50 | static NSArray *mods = nil; 51 | static dispatch_once_t onceToken; 52 | dispatch_once(&onceToken, ^{ 53 | mods = FFReadConfiguration(WKAppEventModSectName); 54 | }); 55 | return mods; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKAppEventModuleManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventModuleManager.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface WKAppEventModuleManager : NSObject 14 | /** 15 | 当前需要执行的AppEventModule容器 16 | */ 17 | @property (nonatomic, strong) NSMutableArray *appEventModules; 18 | 19 | + (instancetype)sharedInstance; 20 | 21 | /** 22 | 初始化所有的AppDelegate相关的Event Modules 23 | */ 24 | - (void)registedAllModules; 25 | 26 | /** 27 | 触发evetn module处理AppDelegate回调事件 28 | 29 | @param eventSel AppDelegate 回调事件消息 30 | @param complete module处理handle 31 | */ 32 | - (void)handleApplicationEvent:(SEL)eventSel 33 | Complete:(void(^)(id module,SEL sel))complete; 34 | 35 | /** 36 | 移除module对象 37 | 38 | @param moduleID module ID 39 | */ 40 | - (void)removeModule:(NSString *)moduleID; 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKAppEventModuleManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventModuleManager.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKAppEventModuleManager.h" 10 | #import "WKAppEventAnnotation.h" 11 | #import "WKAppEventModuleProtocol.h" 12 | 13 | #define kModuleInfoNameKey @"moduleClass" 14 | #define kModuleInfoLevelKey @"moduleLevel" 15 | 16 | @implementation WKAppEventModuleManager 17 | 18 | + (instancetype)sharedInstance { 19 | static id sharedInstance = nil; 20 | static dispatch_once_t onceToken = 0; 21 | dispatch_once(&onceToken, ^{ 22 | sharedInstance = [[self alloc] init]; 23 | }); 24 | return sharedInstance; 25 | } 26 | 27 | #pragma mark - public methods 28 | 29 | - (void)registedAllModules { 30 | NSArray*mods = [WKAppEventAnnotation AnnotationModules]; 31 | for (NSString *modName in mods) 32 | { 33 | if (modName) 34 | { 35 | Class moduleCls = NSClassFromString(modName); 36 | if (moduleCls && [moduleCls conformsToProtocol:@protocol(WKAppEventModuleProtocol)]) 37 | { 38 | NSMutableDictionary *moduleInfo = [NSMutableDictionary dictionary]; 39 | id moduleInstance = [[moduleCls alloc] init]; 40 | NSInteger levelInt = (NSInteger)[moduleInstance performSelector:@selector(moduleLevel)]; 41 | [moduleInfo setObject:@(levelInt) forKey:kModuleInfoLevelKey]; 42 | [moduleInfo setObject:moduleInstance forKey:kModuleInfoNameKey]; 43 | [self.appEventModules addObject:moduleInfo]; 44 | } 45 | } 46 | } 47 | 48 | [self.appEventModules sortUsingComparator:^NSComparisonResult(NSDictionary *module1, NSDictionary *module2) { 49 | NSNumber *module1Level = (NSNumber *)[module1 objectForKey:kModuleInfoLevelKey]; 50 | NSNumber *module2Level = (NSNumber *)[module2 objectForKey:kModuleInfoLevelKey]; 51 | return [module1Level intValue] > [module2Level intValue]; 52 | }]; 53 | 54 | NSMutableArray *tmpArray = [NSMutableArray array]; 55 | [self.appEventModules enumerateObjectsUsingBlock:^(NSDictionary *module, NSUInteger idx, BOOL * _Nonnull stop) { 56 | id moduleInstance = [module objectForKey:kModuleInfoNameKey]; 57 | [tmpArray addObject:moduleInstance]; 58 | }]; 59 | 60 | [self.appEventModules removeAllObjects]; 61 | [self.appEventModules addObjectsFromArray:tmpArray]; 62 | } 63 | 64 | - (void)handleApplicationEvent:(SEL)eventSel 65 | Complete:(void(^)(id module,SEL sel))complete { 66 | // appEventModules遍历Event过程中,module执行完可以将自己移除 67 | // 这里赋值为临时array,防止array遍历过程中移除自己导致出错 68 | NSMutableArray *tmpAppEventModules = [[NSMutableArray alloc] initWithArray:self.appEventModules]; 69 | for (idmodule in tmpAppEventModules) 70 | { 71 | if ([module conformsToProtocol:@protocol(WKAppEventModuleProtocol)]) 72 | { 73 | if ([module respondsToSelector:eventSel]) { 74 | if (complete) { 75 | complete(module,eventSel); 76 | } 77 | } 78 | } 79 | } 80 | } 81 | 82 | - (void)removeModule:(NSString *)moduleID { 83 | NSInteger index = NSNotFound; 84 | NSInteger resIndex = 0; 85 | for (idmodule in self.appEventModules) 86 | { 87 | if ([[module moduleID] isEqualToString:moduleID]) 88 | { 89 | index = resIndex; 90 | break; 91 | } 92 | resIndex++; 93 | } 94 | 95 | if (index != NSNotFound) { 96 | [self.appEventModules removeObjectAtIndex:index]; 97 | } 98 | } 99 | 100 | #pragma mark - getter 101 | 102 | - (NSMutableArray *)appEventModules { 103 | if (!_appEventModules) { 104 | _appEventModules = [NSMutableArray array]; 105 | } 106 | return _appEventModules; 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKAppEventModuleProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventModuleProtocol.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "WKAppEventAnnotation.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol WKAppEventModuleProtocol 16 | 17 | /** 18 | mudule执行优先级 19 | 20 | @return return value description 21 | */ 22 | - (NSInteger)moduleLevel; 23 | 24 | 25 | /** 26 | 执行完成释放module 27 | */ 28 | - (void)destroyModule; 29 | 30 | 31 | /** 32 | 获取module id 33 | 34 | @return id 35 | */ 36 | - (NSString *)moduleID; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKBaseAppEventModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKBaseAppEventModule.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WKAppEventModuleProtocol.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface WKBaseAppEventModule : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/WKAppDelegate/WKBaseAppEventModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKBaseAppEventModule.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBaseAppEventModule.h" 10 | #import "WKAppEventModuleManager.h" 11 | 12 | #define MODULE_LEVEL_DEFAULT 100 13 | 14 | @implementation WKBaseAppEventModule 15 | 16 | - (NSInteger)moduleLevel { 17 | return MODULE_LEVEL_DEFAULT; 18 | } 19 | 20 | - (void)destroyModule { 21 | [[WKAppEventModuleManager sharedInstance] removeModule:[self moduleID]]; 22 | NSLog(@"%@ destroy",NSStringFromClass([self class])); 23 | } 24 | 25 | - (NSString *)moduleID { 26 | return NSStringFromClass([self class]); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /WKAppDelegate-demo/WKAppDelegate-demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WKAppDelegate.podspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pod::Spec.new do |spec| 4 | 5 | 6 | 7 | spec.name = "WKAppDelegate" 8 | spec.version = "0.0.6" 9 | spec.summary = "一个对APPDelegate深度解耦的逻辑." 10 | 11 | 12 | 13 | spec.homepage = "https://github.com/GitWangKai/WKAppDelegate" 14 | 15 | 16 | spec.license = { :type => "MIT", :file => "LICENSE" } 17 | 18 | 19 | spec.author = { "王凯" => "18500052382@163.com" } 20 | 21 | spec.platform = :ios, "6.0" 22 | 23 | 24 | spec.source = { :git => "https://github.com/GitWangKai/WKAppDelegate.git", :tag => "#{spec.version}" } 25 | 26 | 27 | spec.source_files = "WKAppDelegate/**/*.{h,m}" 28 | 29 | 30 | 31 | end 32 | -------------------------------------------------------------------------------- /WKAppDelegate/NSObject+AppEventModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AppEventModule.h 3 | // Pods-WKAppDelegate-demo 4 | // 5 | // Created by Kevin on 2019/5/8. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface NSObject (AppEventModule) 13 | 14 | - (id)performSelector:(SEL)selector 15 | withObject:(id)p1 16 | withObject:(id)p2 17 | withObject:(id)p3; 18 | 19 | - (id)performSelector:(SEL)selector 20 | withObject:(id)p1 21 | withObject:(id)p2 22 | withObject:(id)p3 23 | withObject:(id)p4; 24 | 25 | - (id)performSelector:(SEL)selector 26 | withObject:(id)p1 27 | withObject:(id)p2 28 | withObject:(id)p3 29 | withObject:(id)p4 30 | withObject:(id)p5; 31 | 32 | - (id)performSelector:(SEL)selector 33 | withObject:(id)p1 34 | withObject:(id)p2 35 | withObject:(id)p3 36 | withObject:(id)p4 37 | withObject:(id)p5 38 | withObject:(id)p6; 39 | 40 | - (id)performSelector:(SEL)selector 41 | withObject:(id)p1 42 | withObject:(id)p2 43 | withObject:(id)p3 44 | withObject:(id)p4 45 | withObject:(id)p5 46 | withObject:(id)p6 47 | withObject:(id)p7; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | -------------------------------------------------------------------------------- /WKAppDelegate/NSObject+AppEventModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AppEventModule.m 3 | // Pods-WKAppDelegate-demo 4 | // 5 | // Created by Kevin on 2019/5/8. 6 | // 7 | 8 | #import "NSObject+AppEventModule.h" 9 | 10 | @implementation NSObject (AppEventModule) 11 | 12 | - (id)performSelector:(SEL)selector 13 | withObject:(id)p1 14 | withObject:(id)p2 15 | withObject:(id)p3 { 16 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 17 | if (sig) { 18 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 19 | [invo setTarget:self]; 20 | [invo setSelector:selector]; 21 | [invo setArgument:&p1 atIndex:2]; 22 | [invo setArgument:&p2 atIndex:3]; 23 | [invo setArgument:&p3 atIndex:4]; 24 | [invo invoke]; 25 | if (sig.methodReturnLength) { 26 | return [self handleReturnType:sig invo:invo]; 27 | } else { 28 | return nil; 29 | } 30 | } else { 31 | return nil; 32 | } 33 | } 34 | 35 | - (id)performSelector:(SEL)selector 36 | withObject:(id)p1 37 | withObject:(id)p2 38 | withObject:(id)p3 39 | withObject:(id)p4 { 40 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 41 | if (sig) { 42 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 43 | [invo setTarget:self]; 44 | [invo setSelector:selector]; 45 | [invo setArgument:&p1 atIndex:2]; 46 | [invo setArgument:&p2 atIndex:3]; 47 | [invo setArgument:&p3 atIndex:4]; 48 | [invo setArgument:&p4 atIndex:5]; 49 | [invo invoke]; 50 | if (sig.methodReturnLength) { 51 | return [self handleReturnType:sig invo:invo]; 52 | } else { 53 | return nil; 54 | } 55 | } else { 56 | return nil; 57 | } 58 | } 59 | 60 | - (id)performSelector:(SEL)selector 61 | withObject:(id)p1 62 | withObject:(id)p2 63 | withObject:(id)p3 64 | withObject:(id)p4 65 | withObject:(id)p5 { 66 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 67 | if (sig) { 68 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 69 | [invo setTarget:self]; 70 | [invo setSelector:selector]; 71 | [invo setArgument:&p1 atIndex:2]; 72 | [invo setArgument:&p2 atIndex:3]; 73 | [invo setArgument:&p3 atIndex:4]; 74 | [invo setArgument:&p4 atIndex:5]; 75 | [invo setArgument:&p5 atIndex:6]; 76 | [invo invoke]; 77 | if (sig.methodReturnLength) { 78 | return [self handleReturnType:sig invo:invo]; 79 | } else { 80 | return nil; 81 | } 82 | } else { 83 | return nil; 84 | } 85 | } 86 | 87 | - (id)performSelector:(SEL)selector 88 | withObject:(id)p1 89 | withObject:(id)p2 90 | withObject:(id)p3 91 | withObject:(id)p4 92 | withObject:(id)p5 93 | withObject:(id)p6 { 94 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 95 | if (sig) { 96 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 97 | [invo setTarget:self]; 98 | [invo setSelector:selector]; 99 | [invo setArgument:&p1 atIndex:2]; 100 | [invo setArgument:&p2 atIndex:3]; 101 | [invo setArgument:&p3 atIndex:4]; 102 | [invo setArgument:&p4 atIndex:5]; 103 | [invo setArgument:&p5 atIndex:6]; 104 | [invo setArgument:&p6 atIndex:7]; 105 | [invo invoke]; 106 | if (sig.methodReturnLength) { 107 | return [self handleReturnType:sig invo:invo]; 108 | } else { 109 | return nil; 110 | } 111 | } else { 112 | return nil; 113 | } 114 | } 115 | 116 | - (id)performSelector:(SEL)selector 117 | withObject:(id)p1 118 | withObject:(id)p2 119 | withObject:(id)p3 120 | withObject:(id)p4 121 | withObject:(id)p5 122 | withObject:(id)p6 123 | withObject:(id)p7 { 124 | NSMethodSignature *sig = [self methodSignatureForSelector:selector]; 125 | if (sig) { 126 | NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig]; 127 | [invo setTarget:self]; 128 | [invo setSelector:selector]; 129 | [invo setArgument:&p1 atIndex:2]; 130 | [invo setArgument:&p2 atIndex:3]; 131 | [invo setArgument:&p3 atIndex:4]; 132 | [invo setArgument:&p4 atIndex:5]; 133 | [invo setArgument:&p5 atIndex:6]; 134 | [invo setArgument:&p6 atIndex:7]; 135 | [invo setArgument:&p7 atIndex:8]; 136 | [invo invoke]; 137 | if (sig.methodReturnLength) { 138 | return [self handleReturnType:sig invo:invo]; 139 | } else { 140 | return nil; 141 | } 142 | } else { 143 | return nil; 144 | } 145 | } 146 | 147 | #pragma mark - Private Method 148 | - (id)handleReturnType:(NSMethodSignature *)sig invo:(NSInvocation *)aInvo 149 | { 150 | int booResult = strcmp([sig methodReturnType], @encode(BOOL)); 151 | int floatResult = strcmp([sig methodReturnType], @encode(float)); 152 | int intResult = strcmp([sig methodReturnType], @encode(int)); 153 | 154 | id anObject = nil; 155 | if (booResult == 0) 156 | { 157 | BOOL result; 158 | [aInvo getReturnValue:&result]; 159 | anObject = [NSNumber numberWithBool:result]; 160 | } 161 | else if (floatResult == 0) 162 | { 163 | float result; 164 | [aInvo getReturnValue:&result]; 165 | anObject = [NSNumber numberWithFloat:result]; 166 | } 167 | else if (intResult) 168 | { 169 | int result; 170 | [aInvo getReturnValue:&result]; 171 | anObject = [NSNumber numberWithInt:result]; 172 | } 173 | return anObject; 174 | } 175 | 176 | @end 177 | -------------------------------------------------------------------------------- /WKAppDelegate/WKAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppDelegate.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface WKAppDelegate : UIResponder 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /WKAppDelegate/WKAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppDelegate.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKAppDelegate.h" 10 | #import "WKAppEventModuleManager.h" 11 | #import "NSObject+AppEventModule.h" 12 | 13 | @implementation WKAppDelegate 14 | 15 | + (void)load { 16 | [[WKAppEventModuleManager sharedInstance] registedAllModules]; 17 | } 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | 21 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application:didFinishLaunchingWithOptions:) 22 | Complete:^(id _Nonnull module, SEL _Nonnull sel) { 23 | #pragma clang diagnostic push 24 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 25 | [module performSelector:sel 26 | withObject:application 27 | withObject:launchOptions]; 28 | #pragma clang diagnostic pop 29 | }]; 30 | return YES; 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application { 34 | 35 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(applicationDidEnterBackground:) 36 | Complete:^(id _Nonnull module, SEL _Nonnull sel) { 37 | #pragma clang diagnostic push 38 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 39 | [module performSelector:sel 40 | withObject:application]; 41 | #pragma clang diagnostic pop 42 | }]; 43 | } 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application { 46 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(applicationWillEnterForeground:) 47 | Complete:^(id _Nonnull module, SEL _Nonnull sel) { 48 | #pragma clang diagnostic push 49 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 50 | [module performSelector:sel withObject:application]; 51 | #pragma clang diagnostic pop 52 | }]; 53 | } 54 | 55 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler 56 | API_AVAILABLE(ios(7.0)){ 57 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application:didReceiveRemoteNotification:fetchCompletionHandler:) 58 | Complete:^(id module, SEL sel) { 59 | [module performSelector:sel 60 | withObject:application 61 | withObject:userInfo 62 | withObject:completionHandler]; 63 | }]; 64 | } 65 | 66 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 67 | { 68 | __block BOOL result = YES; 69 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application: 70 | openURL: 71 | sourceApplication: 72 | annotation:) 73 | Complete:^(id module, SEL sel) 74 | { 75 | NSNumber *moduleRes = [module performSelector:sel 76 | withObject:application 77 | withObject:url 78 | withObject:sourceApplication 79 | withObject:annotation]; 80 | result = [moduleRes boolValue]; 81 | }]; 82 | 83 | return result; 84 | } 85 | 86 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_8_4 87 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options 88 | { 89 | __block BOOL result = YES; 90 | [[WKAppEventModuleManager sharedInstance] handleApplicationEvent:@selector(application: 91 | openURL: 92 | options:) 93 | Complete:^(id module, SEL sel) 94 | { 95 | NSNumber *moduleRes = [module performSelector:sel 96 | withObject:app 97 | withObject:url 98 | withObject:options]; 99 | result = [moduleRes boolValue]; 100 | }]; 101 | 102 | return result; 103 | } 104 | #endif 105 | 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /WKAppDelegate/WKAppEventAnnotation.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventAnnotation.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef WKAppEventModSectName 12 | #define WKAppEventModSectName "WKAppEventMods" 13 | #endif 14 | 15 | #define WKAppEventDATA(sectname) __attribute((used, section("__DATA,"#sectname" "))) 16 | 17 | #define WKAppEventMod(name) \ 18 | char * k##name##_mod WKAppEventDATA(WKAppEventMods) = ""#name""; 19 | 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface WKAppEventAnnotation : NSObject 24 | 25 | + (NSArray *)AnnotationModules; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /WKAppDelegate/WKAppEventAnnotation.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventAnnotation.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKAppEventAnnotation.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | static NSArray* FFReadConfiguration(char *section) 16 | { 17 | NSMutableArray *configs = [NSMutableArray array]; 18 | 19 | Dl_info info; 20 | dladdr(FFReadConfiguration, &info); 21 | 22 | #ifndef __LP64__ 23 | // const struct mach_header *mhp = _dyld_get_image_header(0); // both works as below line 24 | const struct mach_header *mhp = (struct mach_header*)info.dli_fbase; 25 | unsigned long size = 0; 26 | uint32_t *memory = (uint32_t*)getsectiondata(mhp, "__DATA", section, & size); 27 | #else /* defined(__LP64__) */ 28 | const struct mach_header_64 *mhp = (struct mach_header_64*)info.dli_fbase; 29 | unsigned long size = 0; 30 | uint64_t *memory = (uint64_t*)getsectiondata(mhp, "__DATA", section, & size); 31 | #endif /* defined(__LP64__) */ 32 | 33 | for(int idx = 0; idx < size/sizeof(void*); ++idx){ 34 | char *string = (char*)memory[idx]; 35 | 36 | NSString *str = [NSString stringWithUTF8String:string]; 37 | if(!str)continue; 38 | 39 | if(str) [configs addObject:str]; 40 | } 41 | 42 | return configs; 43 | 44 | } 45 | 46 | @implementation WKAppEventAnnotation 47 | 48 | + (NSArray *)AnnotationModules 49 | { 50 | static NSArray *mods = nil; 51 | static dispatch_once_t onceToken; 52 | dispatch_once(&onceToken, ^{ 53 | mods = FFReadConfiguration(WKAppEventModSectName); 54 | }); 55 | return mods; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /WKAppDelegate/WKAppEventModuleManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventModuleManager.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface WKAppEventModuleManager : NSObject 14 | /** 15 | 当前需要执行的AppEventModule容器 16 | */ 17 | @property (nonatomic, strong) NSMutableArray *appEventModules; 18 | 19 | + (instancetype)sharedInstance; 20 | 21 | /** 22 | 初始化所有的AppDelegate相关的Event Modules 23 | */ 24 | - (void)registedAllModules; 25 | 26 | /** 27 | 触发evetn module处理AppDelegate回调事件 28 | 29 | @param eventSel AppDelegate 回调事件消息 30 | @param complete module处理handle 31 | */ 32 | - (void)handleApplicationEvent:(SEL)eventSel 33 | Complete:(void(^)(id module,SEL sel))complete; 34 | 35 | /** 36 | 移除module对象 37 | 38 | @param moduleID module ID 39 | */ 40 | - (void)removeModule:(NSString *)moduleID; 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /WKAppDelegate/WKAppEventModuleManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventModuleManager.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKAppEventModuleManager.h" 10 | #import "WKAppEventAnnotation.h" 11 | #import "WKAppEventModuleProtocol.h" 12 | 13 | #define kModuleInfoNameKey @"moduleClass" 14 | #define kModuleInfoLevelKey @"moduleLevel" 15 | 16 | @implementation WKAppEventModuleManager 17 | 18 | + (instancetype)sharedInstance { 19 | static id sharedInstance = nil; 20 | static dispatch_once_t onceToken = 0; 21 | dispatch_once(&onceToken, ^{ 22 | sharedInstance = [[self alloc] init]; 23 | }); 24 | return sharedInstance; 25 | } 26 | 27 | #pragma mark - public methods 28 | 29 | - (void)registedAllModules { 30 | NSArray*mods = [WKAppEventAnnotation AnnotationModules]; 31 | for (NSString *modName in mods) 32 | { 33 | if (modName) 34 | { 35 | Class moduleCls = NSClassFromString(modName); 36 | if (moduleCls && [moduleCls conformsToProtocol:@protocol(WKAppEventModuleProtocol)]) 37 | { 38 | NSMutableDictionary *moduleInfo = [NSMutableDictionary dictionary]; 39 | id moduleInstance = [[moduleCls alloc] init]; 40 | NSInteger levelInt = (NSInteger)[moduleInstance performSelector:@selector(moduleLevel)]; 41 | [moduleInfo setObject:@(levelInt) forKey:kModuleInfoLevelKey]; 42 | [moduleInfo setObject:moduleInstance forKey:kModuleInfoNameKey]; 43 | [self.appEventModules addObject:moduleInfo]; 44 | } 45 | } 46 | } 47 | 48 | [self.appEventModules sortUsingComparator:^NSComparisonResult(NSDictionary *module1, NSDictionary *module2) { 49 | NSNumber *module1Level = (NSNumber *)[module1 objectForKey:kModuleInfoLevelKey]; 50 | NSNumber *module2Level = (NSNumber *)[module2 objectForKey:kModuleInfoLevelKey]; 51 | return [module1Level intValue] > [module2Level intValue]; 52 | }]; 53 | 54 | NSMutableArray *tmpArray = [NSMutableArray array]; 55 | [self.appEventModules enumerateObjectsUsingBlock:^(NSDictionary *module, NSUInteger idx, BOOL * _Nonnull stop) { 56 | id moduleInstance = [module objectForKey:kModuleInfoNameKey]; 57 | [tmpArray addObject:moduleInstance]; 58 | }]; 59 | 60 | [self.appEventModules removeAllObjects]; 61 | [self.appEventModules addObjectsFromArray:tmpArray]; 62 | } 63 | 64 | - (void)handleApplicationEvent:(SEL)eventSel 65 | Complete:(void(^)(id module,SEL sel))complete { 66 | // appEventModules遍历Event过程中,module执行完可以将自己移除 67 | // 这里赋值为临时array,防止array遍历过程中移除自己导致出错 68 | NSMutableArray *tmpAppEventModules = [[NSMutableArray alloc] initWithArray:self.appEventModules]; 69 | for (idmodule in tmpAppEventModules) 70 | { 71 | if ([module conformsToProtocol:@protocol(WKAppEventModuleProtocol)]) 72 | { 73 | if ([module respondsToSelector:eventSel]) { 74 | if (complete) { 75 | complete(module,eventSel); 76 | } 77 | } 78 | } 79 | } 80 | } 81 | 82 | - (void)removeModule:(NSString *)moduleID { 83 | NSInteger index = NSNotFound; 84 | NSInteger resIndex = 0; 85 | for (idmodule in self.appEventModules) 86 | { 87 | if ([[module moduleID] isEqualToString:moduleID]) 88 | { 89 | index = resIndex; 90 | break; 91 | } 92 | resIndex++; 93 | } 94 | 95 | if (index != NSNotFound) { 96 | [self.appEventModules removeObjectAtIndex:index]; 97 | } 98 | } 99 | 100 | #pragma mark - getter 101 | 102 | - (NSMutableArray *)appEventModules { 103 | if (!_appEventModules) { 104 | _appEventModules = [NSMutableArray array]; 105 | } 106 | return _appEventModules; 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /WKAppDelegate/WKAppEventModuleProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppEventModuleProtocol.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "WKAppEventAnnotation.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol WKAppEventModuleProtocol 16 | 17 | /** 18 | mudule执行优先级 19 | 20 | @return return value description 21 | */ 22 | - (NSInteger)moduleLevel; 23 | 24 | 25 | /** 26 | 执行完成释放module 27 | */ 28 | - (void)destroyModule; 29 | 30 | 31 | /** 32 | 获取module id 33 | 34 | @return id 35 | */ 36 | - (NSString *)moduleID; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /WKAppDelegate/WKBaseAppEventModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKBaseAppEventModule.h 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WKAppEventModuleProtocol.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface WKBaseAppEventModule : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /WKAppDelegate/WKBaseAppEventModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKBaseAppEventModule.m 3 | // APPEventModule 4 | // 5 | // Created by 王凯 on 2019/2/12. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBaseAppEventModule.h" 10 | #import "WKAppEventModuleManager.h" 11 | 12 | #define MODULE_LEVEL_DEFAULT 100 13 | 14 | @implementation WKBaseAppEventModule 15 | 16 | - (NSInteger)moduleLevel { 17 | return MODULE_LEVEL_DEFAULT; 18 | } 19 | 20 | - (void)destroyModule { 21 | [[WKAppEventModuleManager sharedInstance] removeModule:[self moduleID]]; 22 | NSLog(@"%@ destroy",NSStringFromClass([self class])); 23 | } 24 | 25 | - (NSString *)moduleID { 26 | return NSStringFromClass([self class]); 27 | } 28 | 29 | @end 30 | --------------------------------------------------------------------------------