├── .DS_Store ├── Example ├── .DS_Store ├── Example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── pennyli.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── litingdong.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ ├── pennyli.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── tingdongli.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── Example.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── litingdong.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ ├── pennyli.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── tingdongli.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── Example │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── RZAppLaunchTask1.h │ ├── RZAppLaunchTask1.m │ ├── RZAppLaunchTask2.h │ ├── RZAppLaunchTask2.m │ ├── RZAppLaunchTask3.h │ ├── RZAppLaunchTask3.m │ ├── RZAppLaunchTask4.h │ ├── RZAppLaunchTask4.m │ ├── RZAppLaunchTask5.h │ ├── RZAppLaunchTask5.m │ ├── RZAppLaunchTask6.h │ ├── RZAppLaunchTask6.m │ ├── RZAppLaunchTask7.h │ ├── RZAppLaunchTask7.m │ ├── RZLaunchTask.plist │ ├── SceneDelegate.h │ ├── SceneDelegate.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Headers │ ├── Private │ │ └── RZLauncher │ │ │ ├── RZAppLaunchBaseTask.h │ │ │ ├── RZLaunchContext.h │ │ │ ├── RZLaunchProtocol.h │ │ │ ├── RZLauncher.h │ │ │ ├── RZMap.h │ │ │ ├── RZMapNode.h │ │ │ ├── RZModuleBaseProtocol.h │ │ │ ├── RZModuleMediator.h │ │ │ └── RZModuleRegister.h │ └── Public │ │ └── RZLauncher │ │ ├── RZAppLaunchBaseTask.h │ │ ├── RZLaunchContext.h │ │ ├── RZLaunchProtocol.h │ │ ├── RZLauncher.h │ │ ├── RZMap.h │ │ ├── RZMapNode.h │ │ ├── RZModuleBaseProtocol.h │ │ ├── RZModuleMediator.h │ │ └── RZModuleRegister.h │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── tingdongli.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-Example.xcscheme │ │ ├── RZLauncher.xcscheme │ │ └── xcschememanagement.plist │ ├── RZLauncher │ ├── Mediator │ │ └── Classes │ │ │ ├── Map │ │ │ ├── RZMap.h │ │ │ ├── RZMap.m │ │ │ ├── RZMapNode.h │ │ │ └── RZMapNode.m │ │ │ ├── RZAppLaunchBaseTask.h │ │ │ ├── RZAppLaunchBaseTask.m │ │ │ ├── RZLaunchContext.h │ │ │ ├── RZLaunchContext.m │ │ │ ├── RZLaunchProtocol.h │ │ │ ├── RZLauncher.h │ │ │ ├── RZLauncher.m │ │ │ ├── RZModuleBaseProtocol.h │ │ │ ├── RZModuleMediator.h │ │ │ ├── RZModuleMediator.m │ │ │ ├── RZModuleRegister.h │ │ │ └── RZModuleRegister.m │ └── README.md │ └── Target Support Files │ ├── Pods-Example │ ├── Pods-Example-acknowledgements.markdown │ ├── Pods-Example-acknowledgements.plist │ ├── Pods-Example-dummy.m │ ├── Pods-Example.debug.xcconfig │ └── Pods-Example.release.xcconfig │ └── RZLauncher │ ├── RZLauncher-dummy.m │ ├── RZLauncher-prefix.pch │ └── RZLauncher.xcconfig ├── Gemfile ├── Gemfile.lock ├── Mediator └── Classes │ ├── Map │ ├── RZMap.h │ ├── RZMap.m │ ├── RZMapNode.h │ └── RZMapNode.m │ ├── RZAppLaunchBaseTask.h │ ├── RZAppLaunchBaseTask.m │ ├── RZLaunchContext.h │ ├── RZLaunchContext.m │ ├── RZLaunchProtocol.h │ ├── RZLauncher.h │ ├── RZLauncher.m │ ├── RZModuleBaseProtocol.h │ ├── RZModuleMediator.h │ ├── RZModuleMediator.m │ ├── RZModuleRegister.h │ └── RZModuleRegister.m └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruzhuxiaogu/RZLauncher/dc76fe963573855466d606db4964f8e17768f2a3/.DS_Store -------------------------------------------------------------------------------- /Example/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruzhuxiaogu/RZLauncher/dc76fe963573855466d606db4964f8e17768f2a3/Example/.DS_Store -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7001C52E24F3D9A3002361AC /* RZLaunchTask.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7001C52D24F3D9A3002361AC /* RZLaunchTask.plist */; }; 11 | 7008E8A124EA6235007C3A59 /* RZAppLaunchTask1.m in Sources */ = {isa = PBXBuildFile; fileRef = 7008E8A024EA6235007C3A59 /* RZAppLaunchTask1.m */; }; 12 | 7008E9DE24EA6289007C3A59 /* RZAppLaunchTask2.m in Sources */ = {isa = PBXBuildFile; fileRef = 7008E9DD24EA6289007C3A59 /* RZAppLaunchTask2.m */; }; 13 | 7008E9E124EA629D007C3A59 /* RZAppLaunchTask3.m in Sources */ = {isa = PBXBuildFile; fileRef = 7008E9E024EA629D007C3A59 /* RZAppLaunchTask3.m */; }; 14 | 7008E9E424EA6452007C3A59 /* RZAppLaunchTask4.m in Sources */ = {isa = PBXBuildFile; fileRef = 7008E9E324EA6452007C3A59 /* RZAppLaunchTask4.m */; }; 15 | 7008E9E724EA6485007C3A59 /* RZAppLaunchTask5.m in Sources */ = {isa = PBXBuildFile; fileRef = 7008E9E624EA6485007C3A59 /* RZAppLaunchTask5.m */; }; 16 | 7008E9EA24EA6AEF007C3A59 /* RZAppLaunchTask6.m in Sources */ = {isa = PBXBuildFile; fileRef = 7008E9E924EA6AEF007C3A59 /* RZAppLaunchTask6.m */; }; 17 | 7008E9ED24EA6F1D007C3A59 /* RZAppLaunchTask7.m in Sources */ = {isa = PBXBuildFile; fileRef = 7008E9EC24EA6F1D007C3A59 /* RZAppLaunchTask7.m */; }; 18 | A8AB1ACD23BED42200F59DE2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A8AB1ACC23BED42200F59DE2 /* AppDelegate.m */; }; 19 | A8AB1AD023BED42200F59DE2 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A8AB1ACF23BED42200F59DE2 /* SceneDelegate.m */; }; 20 | A8AB1AD323BED42200F59DE2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A8AB1AD223BED42200F59DE2 /* ViewController.m */; }; 21 | A8AB1AD623BED42200F59DE2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A8AB1AD423BED42200F59DE2 /* Main.storyboard */; }; 22 | A8AB1AD823BED42300F59DE2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A8AB1AD723BED42300F59DE2 /* Assets.xcassets */; }; 23 | A8AB1ADB23BED42300F59DE2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A8AB1AD923BED42300F59DE2 /* LaunchScreen.storyboard */; }; 24 | A8AB1ADE23BED42300F59DE2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A8AB1ADD23BED42300F59DE2 /* main.m */; }; 25 | F36A4C3838FB9A5462DFA38D /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CF550ABBC572D897AD98C86 /* libPods-Example.a */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 156C31811478F8542BFBA71F /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; 30 | 2A8AB929AF7241BED6EDE0E7 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; 31 | 6CF550ABBC572D897AD98C86 /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 7001C52D24F3D9A3002361AC /* RZLaunchTask.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = RZLaunchTask.plist; sourceTree = ""; }; 33 | 7008E89F24EA6235007C3A59 /* RZAppLaunchTask1.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZAppLaunchTask1.h; sourceTree = ""; }; 34 | 7008E8A024EA6235007C3A59 /* RZAppLaunchTask1.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RZAppLaunchTask1.m; sourceTree = ""; }; 35 | 7008E9DC24EA6289007C3A59 /* RZAppLaunchTask2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZAppLaunchTask2.h; sourceTree = ""; }; 36 | 7008E9DD24EA6289007C3A59 /* RZAppLaunchTask2.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RZAppLaunchTask2.m; sourceTree = ""; }; 37 | 7008E9DF24EA629D007C3A59 /* RZAppLaunchTask3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZAppLaunchTask3.h; sourceTree = ""; }; 38 | 7008E9E024EA629D007C3A59 /* RZAppLaunchTask3.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RZAppLaunchTask3.m; sourceTree = ""; }; 39 | 7008E9E224EA6452007C3A59 /* RZAppLaunchTask4.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZAppLaunchTask4.h; sourceTree = ""; }; 40 | 7008E9E324EA6452007C3A59 /* RZAppLaunchTask4.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RZAppLaunchTask4.m; sourceTree = ""; }; 41 | 7008E9E524EA6485007C3A59 /* RZAppLaunchTask5.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZAppLaunchTask5.h; sourceTree = ""; }; 42 | 7008E9E624EA6485007C3A59 /* RZAppLaunchTask5.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RZAppLaunchTask5.m; sourceTree = ""; }; 43 | 7008E9E824EA6AEF007C3A59 /* RZAppLaunchTask6.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZAppLaunchTask6.h; sourceTree = ""; }; 44 | 7008E9E924EA6AEF007C3A59 /* RZAppLaunchTask6.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RZAppLaunchTask6.m; sourceTree = ""; }; 45 | 7008E9EB24EA6F1D007C3A59 /* RZAppLaunchTask7.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RZAppLaunchTask7.h; sourceTree = ""; }; 46 | 7008E9EC24EA6F1D007C3A59 /* RZAppLaunchTask7.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RZAppLaunchTask7.m; sourceTree = ""; }; 47 | A8AB1AC823BED42200F59DE2 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | A8AB1ACB23BED42200F59DE2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | A8AB1ACC23BED42200F59DE2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | A8AB1ACE23BED42200F59DE2 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; 51 | A8AB1ACF23BED42200F59DE2 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; 52 | A8AB1AD123BED42200F59DE2 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 53 | A8AB1AD223BED42200F59DE2 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 54 | A8AB1AD523BED42200F59DE2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 55 | A8AB1AD723BED42300F59DE2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | A8AB1ADA23BED42300F59DE2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 57 | A8AB1ADC23BED42300F59DE2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | A8AB1ADD23BED42300F59DE2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | A8AB1AC523BED42200F59DE2 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | F36A4C3838FB9A5462DFA38D /* libPods-Example.a in Frameworks */, 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | /* End PBXFrameworksBuildPhase section */ 71 | 72 | /* Begin PBXGroup section */ 73 | 7118DBCE24AD731056B5CB5A /* Frameworks */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 6CF550ABBC572D897AD98C86 /* libPods-Example.a */, 77 | ); 78 | name = Frameworks; 79 | sourceTree = ""; 80 | }; 81 | A8AB1ABF23BED42200F59DE2 = { 82 | isa = PBXGroup; 83 | children = ( 84 | A8AB1ACA23BED42200F59DE2 /* Example */, 85 | A8AB1AC923BED42200F59DE2 /* Products */, 86 | C2361A97494D954EADA60640 /* Pods */, 87 | 7118DBCE24AD731056B5CB5A /* Frameworks */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | A8AB1AC923BED42200F59DE2 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | A8AB1AC823BED42200F59DE2 /* Example.app */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | A8AB1ACA23BED42200F59DE2 /* Example */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | A8AB1ACB23BED42200F59DE2 /* AppDelegate.h */, 103 | A8AB1ACC23BED42200F59DE2 /* AppDelegate.m */, 104 | A8AB1ACE23BED42200F59DE2 /* SceneDelegate.h */, 105 | A8AB1ACF23BED42200F59DE2 /* SceneDelegate.m */, 106 | A8AB1AD123BED42200F59DE2 /* ViewController.h */, 107 | A8AB1AD223BED42200F59DE2 /* ViewController.m */, 108 | A8AB1AD423BED42200F59DE2 /* Main.storyboard */, 109 | A8AB1AD723BED42300F59DE2 /* Assets.xcassets */, 110 | A8AB1AD923BED42300F59DE2 /* LaunchScreen.storyboard */, 111 | A8AB1ADC23BED42300F59DE2 /* Info.plist */, 112 | A8AB1ADD23BED42300F59DE2 /* main.m */, 113 | 7008E89F24EA6235007C3A59 /* RZAppLaunchTask1.h */, 114 | 7008E8A024EA6235007C3A59 /* RZAppLaunchTask1.m */, 115 | 7008E9DC24EA6289007C3A59 /* RZAppLaunchTask2.h */, 116 | 7008E9DD24EA6289007C3A59 /* RZAppLaunchTask2.m */, 117 | 7008E9DF24EA629D007C3A59 /* RZAppLaunchTask3.h */, 118 | 7008E9E024EA629D007C3A59 /* RZAppLaunchTask3.m */, 119 | 7008E9E224EA6452007C3A59 /* RZAppLaunchTask4.h */, 120 | 7008E9E324EA6452007C3A59 /* RZAppLaunchTask4.m */, 121 | 7008E9E524EA6485007C3A59 /* RZAppLaunchTask5.h */, 122 | 7008E9E624EA6485007C3A59 /* RZAppLaunchTask5.m */, 123 | 7008E9E824EA6AEF007C3A59 /* RZAppLaunchTask6.h */, 124 | 7008E9E924EA6AEF007C3A59 /* RZAppLaunchTask6.m */, 125 | 7008E9EB24EA6F1D007C3A59 /* RZAppLaunchTask7.h */, 126 | 7008E9EC24EA6F1D007C3A59 /* RZAppLaunchTask7.m */, 127 | 7001C52D24F3D9A3002361AC /* RZLaunchTask.plist */, 128 | ); 129 | path = Example; 130 | sourceTree = ""; 131 | }; 132 | C2361A97494D954EADA60640 /* Pods */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 156C31811478F8542BFBA71F /* Pods-Example.debug.xcconfig */, 136 | 2A8AB929AF7241BED6EDE0E7 /* Pods-Example.release.xcconfig */, 137 | ); 138 | path = Pods; 139 | sourceTree = ""; 140 | }; 141 | /* End PBXGroup section */ 142 | 143 | /* Begin PBXNativeTarget section */ 144 | A8AB1AC723BED42200F59DE2 /* Example */ = { 145 | isa = PBXNativeTarget; 146 | buildConfigurationList = A8AB1AE123BED42300F59DE2 /* Build configuration list for PBXNativeTarget "Example" */; 147 | buildPhases = ( 148 | 43046F1B6B1A03E133742FF0 /* [CP] Check Pods Manifest.lock */, 149 | A8AB1AC423BED42200F59DE2 /* Sources */, 150 | A8AB1AC523BED42200F59DE2 /* Frameworks */, 151 | A8AB1AC623BED42200F59DE2 /* Resources */, 152 | ); 153 | buildRules = ( 154 | ); 155 | dependencies = ( 156 | ); 157 | name = Example; 158 | productName = Example; 159 | productReference = A8AB1AC823BED42200F59DE2 /* Example.app */; 160 | productType = "com.apple.product-type.application"; 161 | }; 162 | /* End PBXNativeTarget section */ 163 | 164 | /* Begin PBXProject section */ 165 | A8AB1AC023BED42200F59DE2 /* Project object */ = { 166 | isa = PBXProject; 167 | attributes = { 168 | LastUpgradeCheck = 1130; 169 | ORGANIZATIONNAME = tingdongli; 170 | TargetAttributes = { 171 | A8AB1AC723BED42200F59DE2 = { 172 | CreatedOnToolsVersion = 11.3; 173 | }; 174 | }; 175 | }; 176 | buildConfigurationList = A8AB1AC323BED42200F59DE2 /* Build configuration list for PBXProject "Example" */; 177 | compatibilityVersion = "Xcode 9.3"; 178 | developmentRegion = en; 179 | hasScannedForEncodings = 0; 180 | knownRegions = ( 181 | en, 182 | Base, 183 | ); 184 | mainGroup = A8AB1ABF23BED42200F59DE2; 185 | productRefGroup = A8AB1AC923BED42200F59DE2 /* Products */; 186 | projectDirPath = ""; 187 | projectRoot = ""; 188 | targets = ( 189 | A8AB1AC723BED42200F59DE2 /* Example */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | A8AB1AC623BED42200F59DE2 /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | A8AB1ADB23BED42300F59DE2 /* LaunchScreen.storyboard in Resources */, 200 | A8AB1AD823BED42300F59DE2 /* Assets.xcassets in Resources */, 201 | A8AB1AD623BED42200F59DE2 /* Main.storyboard in Resources */, 202 | 7001C52E24F3D9A3002361AC /* RZLaunchTask.plist in Resources */, 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXResourcesBuildPhase section */ 207 | 208 | /* Begin PBXShellScriptBuildPhase section */ 209 | 43046F1B6B1A03E133742FF0 /* [CP] Check Pods Manifest.lock */ = { 210 | isa = PBXShellScriptBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | ); 214 | inputFileListPaths = ( 215 | ); 216 | inputPaths = ( 217 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 218 | "${PODS_ROOT}/Manifest.lock", 219 | ); 220 | name = "[CP] Check Pods Manifest.lock"; 221 | outputFileListPaths = ( 222 | ); 223 | outputPaths = ( 224 | "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | shellPath = /bin/sh; 228 | 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"; 229 | showEnvVarsInLog = 0; 230 | }; 231 | /* End PBXShellScriptBuildPhase section */ 232 | 233 | /* Begin PBXSourcesBuildPhase section */ 234 | A8AB1AC423BED42200F59DE2 /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | 7008E9ED24EA6F1D007C3A59 /* RZAppLaunchTask7.m in Sources */, 239 | 7008E9EA24EA6AEF007C3A59 /* RZAppLaunchTask6.m in Sources */, 240 | 7008E8A124EA6235007C3A59 /* RZAppLaunchTask1.m in Sources */, 241 | A8AB1AD323BED42200F59DE2 /* ViewController.m in Sources */, 242 | A8AB1ACD23BED42200F59DE2 /* AppDelegate.m in Sources */, 243 | A8AB1ADE23BED42300F59DE2 /* main.m in Sources */, 244 | 7008E9E724EA6485007C3A59 /* RZAppLaunchTask5.m in Sources */, 245 | 7008E9E424EA6452007C3A59 /* RZAppLaunchTask4.m in Sources */, 246 | 7008E9E124EA629D007C3A59 /* RZAppLaunchTask3.m in Sources */, 247 | 7008E9DE24EA6289007C3A59 /* RZAppLaunchTask2.m in Sources */, 248 | A8AB1AD023BED42200F59DE2 /* SceneDelegate.m in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXSourcesBuildPhase section */ 253 | 254 | /* Begin PBXVariantGroup section */ 255 | A8AB1AD423BED42200F59DE2 /* Main.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | A8AB1AD523BED42200F59DE2 /* Base */, 259 | ); 260 | name = Main.storyboard; 261 | sourceTree = ""; 262 | }; 263 | A8AB1AD923BED42300F59DE2 /* LaunchScreen.storyboard */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | A8AB1ADA23BED42300F59DE2 /* Base */, 267 | ); 268 | name = LaunchScreen.storyboard; 269 | sourceTree = ""; 270 | }; 271 | /* End PBXVariantGroup section */ 272 | 273 | /* Begin XCBuildConfiguration section */ 274 | A8AB1ADF23BED42300F59DE2 /* Debug */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ALWAYS_SEARCH_USER_PATHS = NO; 278 | CLANG_ANALYZER_NONNULL = YES; 279 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 280 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 281 | CLANG_CXX_LIBRARY = "libc++"; 282 | CLANG_ENABLE_MODULES = YES; 283 | CLANG_ENABLE_OBJC_ARC = YES; 284 | CLANG_ENABLE_OBJC_WEAK = YES; 285 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 286 | CLANG_WARN_BOOL_CONVERSION = YES; 287 | CLANG_WARN_COMMA = YES; 288 | CLANG_WARN_CONSTANT_CONVERSION = YES; 289 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 291 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 292 | CLANG_WARN_EMPTY_BODY = YES; 293 | CLANG_WARN_ENUM_CONVERSION = YES; 294 | CLANG_WARN_INFINITE_RECURSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 297 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 298 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 299 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 300 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 301 | CLANG_WARN_STRICT_PROTOTYPES = YES; 302 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 303 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 304 | CLANG_WARN_UNREACHABLE_CODE = YES; 305 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 306 | COPY_PHASE_STRIP = NO; 307 | DEBUG_INFORMATION_FORMAT = dwarf; 308 | ENABLE_STRICT_OBJC_MSGSEND = YES; 309 | ENABLE_TESTABILITY = YES; 310 | GCC_C_LANGUAGE_STANDARD = gnu11; 311 | GCC_DYNAMIC_NO_PIC = NO; 312 | GCC_NO_COMMON_BLOCKS = YES; 313 | GCC_OPTIMIZATION_LEVEL = 0; 314 | GCC_PREPROCESSOR_DEFINITIONS = ( 315 | "DEBUG=1", 316 | "$(inherited)", 317 | ); 318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 320 | GCC_WARN_UNDECLARED_SELECTOR = YES; 321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 322 | GCC_WARN_UNUSED_FUNCTION = YES; 323 | GCC_WARN_UNUSED_VARIABLE = YES; 324 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 325 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 326 | MTL_FAST_MATH = YES; 327 | ONLY_ACTIVE_ARCH = YES; 328 | SDKROOT = iphoneos; 329 | }; 330 | name = Debug; 331 | }; 332 | A8AB1AE023BED42300F59DE2 /* Release */ = { 333 | isa = XCBuildConfiguration; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_ANALYZER_NONNULL = YES; 337 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_ENABLE_OBJC_WEAK = YES; 343 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_COMMA = YES; 346 | CLANG_WARN_CONSTANT_CONVERSION = YES; 347 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 348 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 349 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 350 | CLANG_WARN_EMPTY_BODY = YES; 351 | CLANG_WARN_ENUM_CONVERSION = YES; 352 | CLANG_WARN_INFINITE_RECURSION = YES; 353 | CLANG_WARN_INT_CONVERSION = YES; 354 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 355 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 359 | CLANG_WARN_STRICT_PROTOTYPES = YES; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 362 | CLANG_WARN_UNREACHABLE_CODE = YES; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | COPY_PHASE_STRIP = NO; 365 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 366 | ENABLE_NS_ASSERTIONS = NO; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | GCC_C_LANGUAGE_STANDARD = gnu11; 369 | GCC_NO_COMMON_BLOCKS = YES; 370 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 371 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 372 | GCC_WARN_UNDECLARED_SELECTOR = YES; 373 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 374 | GCC_WARN_UNUSED_FUNCTION = YES; 375 | GCC_WARN_UNUSED_VARIABLE = YES; 376 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 377 | MTL_ENABLE_DEBUG_INFO = NO; 378 | MTL_FAST_MATH = YES; 379 | SDKROOT = iphoneos; 380 | VALIDATE_PRODUCT = YES; 381 | }; 382 | name = Release; 383 | }; 384 | A8AB1AE223BED42300F59DE2 /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | baseConfigurationReference = 156C31811478F8542BFBA71F /* Pods-Example.debug.xcconfig */; 387 | buildSettings = { 388 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 389 | CODE_SIGN_STYLE = Automatic; 390 | INFOPLIST_FILE = Example/Info.plist; 391 | LD_RUNPATH_SEARCH_PATHS = ( 392 | "$(inherited)", 393 | "@executable_path/Frameworks", 394 | ); 395 | PRODUCT_BUNDLE_IDENTIFIER = com.tencent.Example; 396 | PRODUCT_NAME = "$(TARGET_NAME)"; 397 | TARGETED_DEVICE_FAMILY = "1,2"; 398 | }; 399 | name = Debug; 400 | }; 401 | A8AB1AE323BED42300F59DE2 /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | baseConfigurationReference = 2A8AB929AF7241BED6EDE0E7 /* Pods-Example.release.xcconfig */; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | CODE_SIGN_STYLE = Automatic; 407 | INFOPLIST_FILE = Example/Info.plist; 408 | LD_RUNPATH_SEARCH_PATHS = ( 409 | "$(inherited)", 410 | "@executable_path/Frameworks", 411 | ); 412 | PRODUCT_BUNDLE_IDENTIFIER = com.tencent.Example; 413 | PRODUCT_NAME = "$(TARGET_NAME)"; 414 | TARGETED_DEVICE_FAMILY = "1,2"; 415 | }; 416 | name = Release; 417 | }; 418 | /* End XCBuildConfiguration section */ 419 | 420 | /* Begin XCConfigurationList section */ 421 | A8AB1AC323BED42200F59DE2 /* Build configuration list for PBXProject "Example" */ = { 422 | isa = XCConfigurationList; 423 | buildConfigurations = ( 424 | A8AB1ADF23BED42300F59DE2 /* Debug */, 425 | A8AB1AE023BED42300F59DE2 /* Release */, 426 | ); 427 | defaultConfigurationIsVisible = 0; 428 | defaultConfigurationName = Release; 429 | }; 430 | A8AB1AE123BED42300F59DE2 /* Build configuration list for PBXNativeTarget "Example" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | A8AB1AE223BED42300F59DE2 /* Debug */, 434 | A8AB1AE323BED42300F59DE2 /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | defaultConfigurationName = Release; 438 | }; 439 | /* End XCConfigurationList section */ 440 | }; 441 | rootObject = A8AB1AC023BED42200F59DE2 /* Project object */; 442 | } 443 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/xcuserdata/pennyli.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruzhuxiaogu/RZLauncher/dc76fe963573855466d606db4964f8e17768f2a3/Example/Example.xcodeproj/project.xcworkspace/xcuserdata/pennyli.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/Example.xcodeproj/xcuserdata/litingdong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Example.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/xcuserdata/pennyli.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Example.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/xcuserdata/tingdongli.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Example.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcuserdata/litingdong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruzhuxiaogu/RZLauncher/dc76fe963573855466d606db4964f8e17768f2a3/Example/Example.xcworkspace/xcuserdata/litingdong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcuserdata/pennyli.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruzhuxiaogu/RZLauncher/dc76fe963573855466d606db4964f8e17768f2a3/Example/Example.xcworkspace/xcuserdata/pennyli.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcuserdata/pennyli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcuserdata/tingdongli.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruzhuxiaogu/RZLauncher/dc76fe963573855466d606db4964f8e17768f2a3/Example/Example.xcworkspace/xcuserdata/tingdongli.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcuserdata/tingdongli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Example 4 | // 5 | // Created by 李鹏 on 2020/1/3. 6 | // Copyright © 2020 pennyli. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Example 4 | // 5 | // Created by 李鹏 on 2020/1/3. 6 | // Copyright © 2020 pennyli. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_AppInitialization]; 22 | return YES; 23 | } 24 | 25 | 26 | #pragma mark - UISceneSession lifecycle 27 | 28 | 29 | - (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { 30 | // Called when a new scene session is being created. 31 | // Use this method to select a configuration to create the new scene with. 32 | return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; 33 | } 34 | 35 | 36 | - (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { 37 | // Called when the user discards a scene session. 38 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 39 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 40 | } 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Example/Example/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 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Example/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 | -------------------------------------------------------------------------------- /Example/Example/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 | -------------------------------------------------------------------------------- /Example/Example/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 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIMainStoryboardFile 45 | Main 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | UISupportedInterfaceOrientations~ipad 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationPortraitUpsideDown 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask1.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask1.h 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | RZLAUNCH_REGISTER(RZAppLaunchTask1) 13 | @interface RZAppLaunchTask1 : RZAppLaunchBaseTask 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask1.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask1.m 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchTask1.h" 10 | 11 | @implementation RZAppLaunchTask1 12 | - (BOOL)runForLaunchLife:(NSInteger)life{ 13 | if (life == RZLaunchLife_DidBecomeActive) { 14 | NSLog(@"RZAppLaunchTask1 finished in Thread:%@", [NSThread currentThread]); 15 | } else if (life == RZLaunchLife_AppInitialization) { 16 | NSLog(@"RZLaunchLife_AppInitialization RZAppLaunchTask1 finished in Thread:%@", [NSThread currentThread]); 17 | } 18 | return YES; 19 | } 20 | 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask2.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask2.h 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | RZLAUNCH_REGISTER(RZAppLaunchTask2) 13 | @interface RZAppLaunchTask2 : RZAppLaunchBaseTask 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask2.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask2.m 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchTask2.h" 10 | 11 | @implementation RZAppLaunchTask2 12 | - (BOOL)runForLaunchLife:(NSInteger)life{ 13 | if (life == RZLaunchLife_DidBecomeActive) { 14 | NSLog(@"RZAppLaunchTask2 finished in Thread:%@", [NSThread currentThread]); 15 | }else if (life == RZLaunchLife_AppInitialization) { 16 | NSLog(@"RZLaunchLife_AppInitialization RZAppLaunchTask2 finished in Thread:%@", [NSThread currentThread]); 17 | } 18 | return YES; 19 | } 20 | 21 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life{ 22 | return @[@"RZAppLaunchTask1"]; 23 | } 24 | 25 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life{ 26 | if (life == RZLaunchLife_DidBecomeActive) { 27 | return RZLaunchThread_RunLoopWaiting; 28 | } 29 | return RZLaunchThread_Main; 30 | } 31 | 32 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life{ 33 | return NO; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask3.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask3.h 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | RZLAUNCH_REGISTER(RZAppLaunchTask3) 13 | @interface RZAppLaunchTask3 : RZAppLaunchBaseTask 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask3.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask3.m 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchTask3.h" 10 | 11 | @implementation RZAppLaunchTask3 12 | - (BOOL)runForLaunchLife:(NSInteger)life{ 13 | if (life == RZLaunchLife_DidBecomeActive) { 14 | NSLog(@"RZAppLaunchTask3 finished in Thread:%@", [NSThread currentThread]); 15 | }else if (life == RZLaunchLife_AppInitialization) { 16 | NSLog(@"RZLaunchLife_AppInitialization RZAppLaunchTask3 finished in Thread:%@", [NSThread currentThread]); 17 | } 18 | return YES; 19 | } 20 | 21 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life{ 22 | if (life == RZLaunchLife_DidBecomeActive) { 23 | return @[@"RZAppLaunchTask2"]; 24 | }else if (life == RZLaunchLife_AppInitialization) { 25 | return @[@"RZAppLaunchTask4"]; 26 | } 27 | return nil; 28 | } 29 | 30 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life{ 31 | return RZLaunchThread_Main; 32 | } 33 | 34 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life{ 35 | return YES; 36 | } 37 | @end 38 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask4.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask4.h 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | RZLAUNCH_REGISTER(RZAppLaunchTask4) 13 | @interface RZAppLaunchTask4 : RZAppLaunchBaseTask 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask4.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask4.m 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchTask4.h" 10 | 11 | @implementation RZAppLaunchTask4 12 | - (BOOL)runForLaunchLife:(NSInteger)life{ 13 | if (life == RZLaunchLife_DidBecomeActive) { 14 | NSLog(@"RZAppLaunchTask4 finished in Thread:%@", [NSThread currentThread]); 15 | }else if (life == RZLaunchLife_AppInitialization) { 16 | NSLog(@"RZLaunchLife_AppInitialization RZAppLaunchTask4 finished in Thread:%@", [NSThread currentThread]); 17 | } 18 | return YES; 19 | } 20 | 21 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life{ 22 | if (life == RZLaunchLife_DidBecomeActive) { 23 | return @[@"RZAppLaunchTask3"]; 24 | } 25 | return nil; 26 | } 27 | 28 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life{ 29 | if (life == RZLaunchLife_AppInitialization) { 30 | return RZLaunchThread_Work; 31 | } 32 | return RZLaunchThread_Main; 33 | } 34 | @end 35 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask5.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask5.h 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | RZLAUNCH_REGISTER(RZAppLaunchTask5) 13 | @interface RZAppLaunchTask5 : RZAppLaunchBaseTask 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask5.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask5.m 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchTask5.h" 10 | 11 | @implementation RZAppLaunchTask5 12 | - (BOOL)runForLaunchLife:(NSInteger)life{ 13 | if (life == RZLaunchLife_DidBecomeActive) { 14 | NSLog(@"RZAppLaunchTask5 finished in Thread:%@", [NSThread currentThread]); 15 | } 16 | return YES; 17 | } 18 | 19 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life{ 20 | return @[@"RZAppLaunchTask3"]; 21 | } 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask6.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask6.h 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface RZAppLaunchTask6 : RZAppLaunchBaseTask 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask6.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask6.m 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchTask6.h" 10 | 11 | @implementation RZAppLaunchTask6 12 | - (BOOL)runForLaunchLife:(NSInteger)life{ 13 | if (life == RZLaunchLife_DidBecomeActive) { 14 | NSLog(@"RZAppLaunchTask6 finished in Thread:%@", [NSThread currentThread]); 15 | } 16 | return YES; 17 | } 18 | 19 | 20 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life{ 21 | if (life == RZLaunchLife_DidBecomeActive) { 22 | return RZLaunchThread_Work; 23 | } 24 | return RZLaunchThread_Main; 25 | } 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask7.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask7.h 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface RZAppLaunchTask7 : RZAppLaunchBaseTask 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/RZAppLaunchTask7.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchTask7.m 3 | // Example 4 | // 5 | // Created by tingdongli on 2020/8/17. 6 | // Copyright © 2020 tingdongli. All rights reserved. 7 | // 8 | 9 | #import "RZAppLaunchTask7.h" 10 | 11 | @implementation RZAppLaunchTask7 12 | - (BOOL)runForLaunchLife:(NSInteger)life{ 13 | if (life == RZLaunchLife_DidBecomeActive) { 14 | NSLog(@"RZAppLaunchTask7 finished in Thread:%@", [NSThread currentThread]); 15 | } 16 | return YES; 17 | } 18 | 19 | 20 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life{ 21 | if (life == RZLaunchLife_DidBecomeActive) { 22 | return RZLaunchThread_Work; 23 | } 24 | return RZLaunchThread_Main; 25 | } 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Example/RZLaunchTask.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RZAppLaunchTask6 6 | 7 | 7 8 | 9 | RZAppLaunchTask2 10 | 11 | 12 | RZAppLaunchTask7 13 | 14 | 7 15 | 16 | RZAppLaunchTask2 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Example/Example/SceneDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.h 3 | // Example 4 | // 5 | // Created by 李鹏 on 2020/1/3. 6 | // Copyright © 2020 pennyli. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SceneDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow * window; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /Example/Example/SceneDelegate.m: -------------------------------------------------------------------------------- 1 | #import "SceneDelegate.h" 2 | #import 3 | 4 | @interface SceneDelegate () 5 | 6 | @end 7 | 8 | @implementation SceneDelegate 9 | 10 | 11 | - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { 12 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 13 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 14 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 15 | } 16 | 17 | 18 | - (void)sceneDidDisconnect:(UIScene *)scene { 19 | // Called as the scene is being released by the system. 20 | // This occurs shortly after the scene enters the background, or when its session is discarded. 21 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 22 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 23 | } 24 | 25 | 26 | - (void)sceneDidBecomeActive:(UIScene *)scene { 27 | // Called when the scene has moved from an inactive state to an active state. 28 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 29 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_DidBecomeActive]; 30 | } 31 | 32 | 33 | - (void)sceneWillResignActive:(UIScene *)scene { 34 | // Called when the scene will move from an active state to an inactive state. 35 | // This may occur due to temporary interruptions (ex. an incoming phone call). 36 | } 37 | 38 | 39 | - (void)sceneWillEnterForeground:(UIScene *)scene { 40 | // Called as the scene transitions from the background to the foreground. 41 | // Use this method to undo the changes made on entering the background. 42 | } 43 | 44 | 45 | - (void)sceneDidEnterBackground:(UIScene *)scene { 46 | // Called as the scene transitions from the foreground to the background. 47 | // Use this method to save data, release shared resources, and store enough scene-specific state information 48 | // to restore the scene back to its current state. 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Example/Example/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Example 4 | // 5 | // Created by 李鹏 on 2020/1/3. 6 | // Copyright © 2020 pennyli. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RZModuleMediator.h" 11 | 12 | @protocol TestProtocol 13 | 14 | - (void)test; 15 | 16 | @end 17 | 18 | @interface TestImpl : NSObject 19 | 20 | @end 21 | 22 | 23 | RZM_EXPORT_MODULE_PROTOCOL(TestProtocol, TestImpl) 24 | 25 | @interface ViewController : UIViewController 26 | 27 | 28 | @end 29 | 30 | -------------------------------------------------------------------------------- /Example/Example/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Example 4 | // 5 | // Created by 李鹏 on 2020/1/3. 6 | // Copyright © 2020 pennyli. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @implementation TestImpl 12 | 13 | - (void)test 14 | { 15 | NSLog(@"123"); 16 | } 17 | 18 | @end 19 | 20 | @interface ViewController () 21 | 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | // Do any additional setup after loading the view. 29 | 30 | [[RZModuleMediator implObjForProtocol: @protocol(TestProtocol)] test]; 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Example 4 | // 5 | // Created by 李鹏 on 2020/1/3. 6 | // Copyright © 2020 pennyli. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | NSString * appDelegateClassName; 14 | @autoreleasepool { 15 | // Setup code that might create autoreleased objects goes here. 16 | appDelegateClassName = NSStringFromClass([AppDelegate class]); 17 | } 18 | return UIApplicationMain(argc, argv, nil, appDelegateClassName); 19 | } 20 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | source "http://git.code.oa.com/kuaibao/Specs.git" 4 | source 'https://github.com/CocoaPods/Specs.git' 5 | 6 | target 'Example' do 7 | # Comment the next line if you don't want to use dynamic frameworks 8 | # use_frameworks! 9 | 10 | # Pods for Example 11 | pod 'RZLauncher', '0.0.1' 12 | 13 | end 14 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - RZLauncher (0.0.1) 3 | 4 | DEPENDENCIES: 5 | - RZLauncher (= 0.0.1) 6 | 7 | SPEC REPOS: 8 | https://github.com/CocoaPods/Specs.git: 9 | - RZLauncher 10 | 11 | SPEC CHECKSUMS: 12 | RZLauncher: fdfeb4540e042215dd8b087295601d5b078c3e00 13 | 14 | PODFILE CHECKSUM: 324b0663fe024d0d6b09c31be50f26b949c4af16 15 | 16 | COCOAPODS: 1.8.4 17 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZAppLaunchBaseTask.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZAppLaunchBaseTask.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZLaunchContext.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZLaunchContext.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZLaunchProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZLaunchProtocol.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZLauncher.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZLauncher.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZMap.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/Map/RZMap.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZMapNode.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/Map/RZMapNode.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZModuleBaseProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZModuleBaseProtocol.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZModuleMediator.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZModuleMediator.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/RZLauncher/RZModuleRegister.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZModuleRegister.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZAppLaunchBaseTask.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZAppLaunchBaseTask.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZLaunchContext.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZLaunchContext.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZLaunchProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZLaunchProtocol.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZLauncher.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZLauncher.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZMap.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/Map/RZMap.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZMapNode.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/Map/RZMapNode.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZModuleBaseProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZModuleBaseProtocol.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZModuleMediator.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZModuleMediator.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/RZLauncher/RZModuleRegister.h: -------------------------------------------------------------------------------- 1 | ../../../RZLauncher/Mediator/Classes/RZModuleRegister.h -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - RZLauncher (0.0.1) 3 | 4 | DEPENDENCIES: 5 | - RZLauncher (= 0.0.1) 6 | 7 | SPEC REPOS: 8 | https://github.com/CocoaPods/Specs.git: 9 | - RZLauncher 10 | 11 | SPEC CHECKSUMS: 12 | RZLauncher: fdfeb4540e042215dd8b087295601d5b078c3e00 13 | 14 | PODFILE CHECKSUM: 324b0663fe024d0d6b09c31be50f26b949c4af16 15 | 16 | COCOAPODS: 1.8.4 17 | -------------------------------------------------------------------------------- /Example/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 | 15454CF93911B5443976FC87A52BB842 /* RZLaunchContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 28CD806D23EB66D9A1246BAA95390C60 /* RZLaunchContext.m */; }; 11 | 32399A8C3A772E0810CF5ADC270B3492 /* RZLaunchContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A10DBD189D838EFB2D346DD751316E37 /* RZLaunchContext.h */; settings = {ATTRIBUTES = (Project, ); }; }; 12 | 3BA001DB0624E2B8AFF0D9EC56620D45 /* RZMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E163DD65BD8E8BD43F6D9B632385CC9 /* RZMap.m */; }; 13 | 44071C50CA52260C3C99460367BCF909 /* RZLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B427AADF9946C2608094F8EFAB3FD47 /* RZLauncher.m */; }; 14 | 4C6002B8266267269BD97D69CAB16173 /* RZModuleRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C17A0270D38E6DBABCEFB8DC4FB108D /* RZModuleRegister.h */; settings = {ATTRIBUTES = (Project, ); }; }; 15 | 4D3FAEF557567FA0E9FF44B09AA2DF77 /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D5BFEF1DDF3D2D328528F7A565F5177D /* Pods-Example-dummy.m */; }; 16 | 517E23F34D819EC42F325E9F13FFCD94 /* RZMapNode.h in Headers */ = {isa = PBXBuildFile; fileRef = CAFD8A3C88793D103E516FE23EEB0746 /* RZMapNode.h */; settings = {ATTRIBUTES = (Project, ); }; }; 17 | 69D633362C56D99F18116C1D4C1198AB /* RZModuleBaseProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5BEB0511936F6D36C9CBEDE8AB75CB /* RZModuleBaseProtocol.h */; settings = {ATTRIBUTES = (Project, ); }; }; 18 | 78A7DF0AB06B181C44CE33AB26115DEE /* RZAppLaunchBaseTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 049E68EE5D85BF7F89A4344624D3F134 /* RZAppLaunchBaseTask.m */; }; 19 | 829F881AEFDFB32C4AC957980AD532D7 /* RZModuleRegister.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E3A32D96CF85CCDECAAD022528B0048 /* RZModuleRegister.m */; }; 20 | A8C426DECF05A86D00502EBB618A5C65 /* RZLauncher.h in Headers */ = {isa = PBXBuildFile; fileRef = 242F7D982252B6A81DFC3C5623E8EFAE /* RZLauncher.h */; settings = {ATTRIBUTES = (Project, ); }; }; 21 | AF6B199ED472ADA73FD686A5C4FCFF1D /* RZModuleMediator.m in Sources */ = {isa = PBXBuildFile; fileRef = 56956F180A265C824913D9EC5BAE23C4 /* RZModuleMediator.m */; }; 22 | B10445A7F49167D534A2257268BA0A03 /* RZAppLaunchBaseTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 57442DBAB5A986D5FD6E1245769E9E45 /* RZAppLaunchBaseTask.h */; settings = {ATTRIBUTES = (Project, ); }; }; 23 | B109A230C116B452E53CA29EFE545AE8 /* RZModuleMediator.h in Headers */ = {isa = PBXBuildFile; fileRef = 04CAB2FD44FD855355BE615495DBCD2B /* RZModuleMediator.h */; settings = {ATTRIBUTES = (Project, ); }; }; 24 | BD67507A3CA3CE1CB2EE773AF7C3ED10 /* RZLauncher-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E6232435218E6039A10D3CD8F0E4BB38 /* RZLauncher-dummy.m */; }; 25 | D2BC3CFD651F86FD63F404766304D59B /* RZMapNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 79270D80AF1A95C8F82F842C249B32A9 /* RZMapNode.m */; }; 26 | E23E20E0DCC740B4950CA393F643BFE2 /* RZMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 5AC096A5072CDF9F30B5A9D7D381DD67 /* RZMap.h */; settings = {ATTRIBUTES = (Project, ); }; }; 27 | EC08CEF197AC439F6AC122C18436DFE0 /* RZLaunchProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 45CC1299D279B2A24A0B6BB052AFA325 /* RZLaunchProtocol.h */; settings = {ATTRIBUTES = (Project, ); }; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | 817F4134AD59A0093DA83E6ABFD128F6 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = F82C0E8700DAC09B452F2DE0D0A15BF2; 36 | remoteInfo = RZLauncher; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 049E68EE5D85BF7F89A4344624D3F134 /* RZAppLaunchBaseTask.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RZAppLaunchBaseTask.m; path = Mediator/Classes/RZAppLaunchBaseTask.m; sourceTree = ""; }; 42 | 04CAB2FD44FD855355BE615495DBCD2B /* RZModuleMediator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZModuleMediator.h; path = Mediator/Classes/RZModuleMediator.h; sourceTree = ""; }; 43 | 1F667CC0E19EAF34E5A4119E2121F585 /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-Example.a"; path = "libPods-Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 242F7D982252B6A81DFC3C5623E8EFAE /* RZLauncher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZLauncher.h; path = Mediator/Classes/RZLauncher.h; sourceTree = ""; }; 45 | 28CD806D23EB66D9A1246BAA95390C60 /* RZLaunchContext.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RZLaunchContext.m; path = Mediator/Classes/RZLaunchContext.m; sourceTree = ""; }; 46 | 2E3A32D96CF85CCDECAAD022528B0048 /* RZModuleRegister.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RZModuleRegister.m; path = Mediator/Classes/RZModuleRegister.m; sourceTree = ""; }; 47 | 3B427AADF9946C2608094F8EFAB3FD47 /* RZLauncher.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RZLauncher.m; path = Mediator/Classes/RZLauncher.m; sourceTree = ""; }; 48 | 45CC1299D279B2A24A0B6BB052AFA325 /* RZLaunchProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZLaunchProtocol.h; path = Mediator/Classes/RZLaunchProtocol.h; sourceTree = ""; }; 49 | 4B5BEB0511936F6D36C9CBEDE8AB75CB /* RZModuleBaseProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZModuleBaseProtocol.h; path = Mediator/Classes/RZModuleBaseProtocol.h; sourceTree = ""; }; 50 | 56956F180A265C824913D9EC5BAE23C4 /* RZModuleMediator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RZModuleMediator.m; path = Mediator/Classes/RZModuleMediator.m; sourceTree = ""; }; 51 | 57442DBAB5A986D5FD6E1245769E9E45 /* RZAppLaunchBaseTask.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZAppLaunchBaseTask.h; path = Mediator/Classes/RZAppLaunchBaseTask.h; sourceTree = ""; }; 52 | 5AC096A5072CDF9F30B5A9D7D381DD67 /* RZMap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZMap.h; path = Mediator/Classes/Map/RZMap.h; sourceTree = ""; }; 53 | 6B4092BC115674C2A278ED7F9C594F9D /* RZLauncher.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RZLauncher.xcconfig; sourceTree = ""; }; 54 | 79270D80AF1A95C8F82F842C249B32A9 /* RZMapNode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RZMapNode.m; path = Mediator/Classes/Map/RZMapNode.m; sourceTree = ""; }; 55 | 7C17A0270D38E6DBABCEFB8DC4FB108D /* RZModuleRegister.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZModuleRegister.h; path = Mediator/Classes/RZModuleRegister.h; sourceTree = ""; }; 56 | 873CDB2CE2AB3D55E7F7846B54D0067E /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = ""; }; 57 | 995512BD8A1204FF064C89218D3D9059 /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = ""; }; 58 | 9A06B2CBC7F57E9BE08460BE730B397B /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = ""; }; 59 | 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; }; 60 | 9E163DD65BD8E8BD43F6D9B632385CC9 /* RZMap.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = RZMap.m; path = Mediator/Classes/Map/RZMap.m; sourceTree = ""; }; 61 | A10DBD189D838EFB2D346DD751316E37 /* RZLaunchContext.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZLaunchContext.h; path = Mediator/Classes/RZLaunchContext.h; sourceTree = ""; }; 62 | ACED3C32FC14FF62A258BE0D4B25BBB3 /* libRZLauncher.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libRZLauncher.a; path = libRZLauncher.a; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | CAFD8A3C88793D103E516FE23EEB0746 /* RZMapNode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RZMapNode.h; path = Mediator/Classes/Map/RZMapNode.h; sourceTree = ""; }; 64 | CEB5CE60F2648C5816E0D295E71A57FF /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = ""; }; 65 | D5BFEF1DDF3D2D328528F7A565F5177D /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = ""; }; 66 | E6232435218E6039A10D3CD8F0E4BB38 /* RZLauncher-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RZLauncher-dummy.m"; sourceTree = ""; }; 67 | FB98BF7FF341302E4357965D1D73B441 /* RZLauncher-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RZLauncher-prefix.pch"; sourceTree = ""; }; 68 | /* End PBXFileReference section */ 69 | 70 | /* Begin PBXFrameworksBuildPhase section */ 71 | 6C7F03D62877EB6EF02A93A48DC99F46 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | DA262CA0AC29A4FDFB0EED352FD9125D /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | 57F3190C91236A94277AFFA9229C839D /* RZLauncher */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 57442DBAB5A986D5FD6E1245769E9E45 /* RZAppLaunchBaseTask.h */, 92 | 049E68EE5D85BF7F89A4344624D3F134 /* RZAppLaunchBaseTask.m */, 93 | A10DBD189D838EFB2D346DD751316E37 /* RZLaunchContext.h */, 94 | 28CD806D23EB66D9A1246BAA95390C60 /* RZLaunchContext.m */, 95 | 242F7D982252B6A81DFC3C5623E8EFAE /* RZLauncher.h */, 96 | 3B427AADF9946C2608094F8EFAB3FD47 /* RZLauncher.m */, 97 | 45CC1299D279B2A24A0B6BB052AFA325 /* RZLaunchProtocol.h */, 98 | 5AC096A5072CDF9F30B5A9D7D381DD67 /* RZMap.h */, 99 | 9E163DD65BD8E8BD43F6D9B632385CC9 /* RZMap.m */, 100 | CAFD8A3C88793D103E516FE23EEB0746 /* RZMapNode.h */, 101 | 79270D80AF1A95C8F82F842C249B32A9 /* RZMapNode.m */, 102 | 4B5BEB0511936F6D36C9CBEDE8AB75CB /* RZModuleBaseProtocol.h */, 103 | 04CAB2FD44FD855355BE615495DBCD2B /* RZModuleMediator.h */, 104 | 56956F180A265C824913D9EC5BAE23C4 /* RZModuleMediator.m */, 105 | 7C17A0270D38E6DBABCEFB8DC4FB108D /* RZModuleRegister.h */, 106 | 2E3A32D96CF85CCDECAAD022528B0048 /* RZModuleRegister.m */, 107 | 5D886A4BA6C731571C8472F864AB1173 /* Support Files */, 108 | ); 109 | name = RZLauncher; 110 | path = RZLauncher; 111 | sourceTree = ""; 112 | }; 113 | 5D886A4BA6C731571C8472F864AB1173 /* Support Files */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 6B4092BC115674C2A278ED7F9C594F9D /* RZLauncher.xcconfig */, 117 | E6232435218E6039A10D3CD8F0E4BB38 /* RZLauncher-dummy.m */, 118 | FB98BF7FF341302E4357965D1D73B441 /* RZLauncher-prefix.pch */, 119 | ); 120 | name = "Support Files"; 121 | path = "../Target Support Files/RZLauncher"; 122 | sourceTree = ""; 123 | }; 124 | 5FEFBFFE4CBFCEE496A3A740F57D04D5 /* Pods-Example */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | CEB5CE60F2648C5816E0D295E71A57FF /* Pods-Example-acknowledgements.markdown */, 128 | 995512BD8A1204FF064C89218D3D9059 /* Pods-Example-acknowledgements.plist */, 129 | D5BFEF1DDF3D2D328528F7A565F5177D /* Pods-Example-dummy.m */, 130 | 873CDB2CE2AB3D55E7F7846B54D0067E /* Pods-Example.debug.xcconfig */, 131 | 9A06B2CBC7F57E9BE08460BE730B397B /* Pods-Example.release.xcconfig */, 132 | ); 133 | name = "Pods-Example"; 134 | path = "Target Support Files/Pods-Example"; 135 | sourceTree = ""; 136 | }; 137 | 63ADAE8BF7815510B4803C406398FAB5 /* Pods */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 57F3190C91236A94277AFFA9229C839D /* RZLauncher */, 141 | ); 142 | name = Pods; 143 | sourceTree = ""; 144 | }; 145 | CF1408CF629C7361332E53B88F7BD30C = { 146 | isa = PBXGroup; 147 | children = ( 148 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, 149 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */, 150 | 63ADAE8BF7815510B4803C406398FAB5 /* Pods */, 151 | D83044DDEC7D76DBA327F67A37315259 /* Products */, 152 | D5B8D0B62F1C86934FF4C6E7C9986E7F /* Targets Support Files */, 153 | ); 154 | sourceTree = ""; 155 | }; 156 | D5B8D0B62F1C86934FF4C6E7C9986E7F /* Targets Support Files */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 5FEFBFFE4CBFCEE496A3A740F57D04D5 /* Pods-Example */, 160 | ); 161 | name = "Targets Support Files"; 162 | sourceTree = ""; 163 | }; 164 | D83044DDEC7D76DBA327F67A37315259 /* Products */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 1F667CC0E19EAF34E5A4119E2121F585 /* libPods-Example.a */, 168 | ACED3C32FC14FF62A258BE0D4B25BBB3 /* libRZLauncher.a */, 169 | ); 170 | name = Products; 171 | sourceTree = ""; 172 | }; 173 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | ); 177 | name = Frameworks; 178 | sourceTree = ""; 179 | }; 180 | /* End PBXGroup section */ 181 | 182 | /* Begin PBXHeadersBuildPhase section */ 183 | A3EAC24AC56ADA629A2EBD0E55FB9035 /* Headers */ = { 184 | isa = PBXHeadersBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | B10445A7F49167D534A2257268BA0A03 /* RZAppLaunchBaseTask.h in Headers */, 188 | 32399A8C3A772E0810CF5ADC270B3492 /* RZLaunchContext.h in Headers */, 189 | A8C426DECF05A86D00502EBB618A5C65 /* RZLauncher.h in Headers */, 190 | EC08CEF197AC439F6AC122C18436DFE0 /* RZLaunchProtocol.h in Headers */, 191 | E23E20E0DCC740B4950CA393F643BFE2 /* RZMap.h in Headers */, 192 | 517E23F34D819EC42F325E9F13FFCD94 /* RZMapNode.h in Headers */, 193 | 69D633362C56D99F18116C1D4C1198AB /* RZModuleBaseProtocol.h in Headers */, 194 | B109A230C116B452E53CA29EFE545AE8 /* RZModuleMediator.h in Headers */, 195 | 4C6002B8266267269BD97D69CAB16173 /* RZModuleRegister.h in Headers */, 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | D9B7AB701597ABEE5C6BE645E9B97FB4 /* Headers */ = { 200 | isa = PBXHeadersBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXHeadersBuildPhase section */ 207 | 208 | /* Begin PBXNativeTarget section */ 209 | 0AEE99A309977BD12A049FF48AF9BA4B /* Pods-Example */ = { 210 | isa = PBXNativeTarget; 211 | buildConfigurationList = C349C5F12485B01EE1C6674739B63B43 /* Build configuration list for PBXNativeTarget "Pods-Example" */; 212 | buildPhases = ( 213 | D9B7AB701597ABEE5C6BE645E9B97FB4 /* Headers */, 214 | 8181BBEAE7F3A6305E345400D1D168C8 /* Sources */, 215 | DA262CA0AC29A4FDFB0EED352FD9125D /* Frameworks */, 216 | ); 217 | buildRules = ( 218 | ); 219 | dependencies = ( 220 | 257095124B4D88A37D13E54064F2CB65 /* PBXTargetDependency */, 221 | ); 222 | name = "Pods-Example"; 223 | productName = "Pods-Example"; 224 | productReference = 1F667CC0E19EAF34E5A4119E2121F585 /* libPods-Example.a */; 225 | productType = "com.apple.product-type.library.static"; 226 | }; 227 | F82C0E8700DAC09B452F2DE0D0A15BF2 /* RZLauncher */ = { 228 | isa = PBXNativeTarget; 229 | buildConfigurationList = AAC8714F1B0D4D6F8F923ED2FD859320 /* Build configuration list for PBXNativeTarget "RZLauncher" */; 230 | buildPhases = ( 231 | A3EAC24AC56ADA629A2EBD0E55FB9035 /* Headers */, 232 | A62172DBE1862DEF88C6BFBBBC4C30A2 /* Sources */, 233 | 6C7F03D62877EB6EF02A93A48DC99F46 /* Frameworks */, 234 | ); 235 | buildRules = ( 236 | ); 237 | dependencies = ( 238 | ); 239 | name = RZLauncher; 240 | productName = RZLauncher; 241 | productReference = ACED3C32FC14FF62A258BE0D4B25BBB3 /* libRZLauncher.a */; 242 | productType = "com.apple.product-type.library.static"; 243 | }; 244 | /* End PBXNativeTarget section */ 245 | 246 | /* Begin PBXProject section */ 247 | BFDFE7DC352907FC980B868725387E98 /* Project object */ = { 248 | isa = PBXProject; 249 | attributes = { 250 | LastSwiftUpdateCheck = 1100; 251 | LastUpgradeCheck = 1100; 252 | }; 253 | buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; 254 | compatibilityVersion = "Xcode 9.3"; 255 | developmentRegion = en; 256 | hasScannedForEncodings = 0; 257 | knownRegions = ( 258 | en, 259 | Base, 260 | ); 261 | mainGroup = CF1408CF629C7361332E53B88F7BD30C; 262 | productRefGroup = D83044DDEC7D76DBA327F67A37315259 /* Products */; 263 | projectDirPath = ""; 264 | projectRoot = ""; 265 | targets = ( 266 | 0AEE99A309977BD12A049FF48AF9BA4B /* Pods-Example */, 267 | F82C0E8700DAC09B452F2DE0D0A15BF2 /* RZLauncher */, 268 | ); 269 | }; 270 | /* End PBXProject section */ 271 | 272 | /* Begin PBXSourcesBuildPhase section */ 273 | 8181BBEAE7F3A6305E345400D1D168C8 /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 4D3FAEF557567FA0E9FF44B09AA2DF77 /* Pods-Example-dummy.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | A62172DBE1862DEF88C6BFBBBC4C30A2 /* Sources */ = { 282 | isa = PBXSourcesBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | 78A7DF0AB06B181C44CE33AB26115DEE /* RZAppLaunchBaseTask.m in Sources */, 286 | 15454CF93911B5443976FC87A52BB842 /* RZLaunchContext.m in Sources */, 287 | BD67507A3CA3CE1CB2EE773AF7C3ED10 /* RZLauncher-dummy.m in Sources */, 288 | 44071C50CA52260C3C99460367BCF909 /* RZLauncher.m in Sources */, 289 | 3BA001DB0624E2B8AFF0D9EC56620D45 /* RZMap.m in Sources */, 290 | D2BC3CFD651F86FD63F404766304D59B /* RZMapNode.m in Sources */, 291 | AF6B199ED472ADA73FD686A5C4FCFF1D /* RZModuleMediator.m in Sources */, 292 | 829F881AEFDFB32C4AC957980AD532D7 /* RZModuleRegister.m in Sources */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | /* End PBXSourcesBuildPhase section */ 297 | 298 | /* Begin PBXTargetDependency section */ 299 | 257095124B4D88A37D13E54064F2CB65 /* PBXTargetDependency */ = { 300 | isa = PBXTargetDependency; 301 | name = RZLauncher; 302 | target = F82C0E8700DAC09B452F2DE0D0A15BF2 /* RZLauncher */; 303 | targetProxy = 817F4134AD59A0093DA83E6ABFD128F6 /* PBXContainerItemProxy */; 304 | }; 305 | /* End PBXTargetDependency section */ 306 | 307 | /* Begin XCBuildConfiguration section */ 308 | 0516847F72E540967716D85C04F0F047 /* Debug */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 6B4092BC115674C2A278ED7F9C594F9D /* RZLauncher.xcconfig */; 311 | buildSettings = { 312 | CODE_SIGN_IDENTITY = "iPhone Developer"; 313 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 314 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 315 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 316 | GCC_PREFIX_HEADER = "Target Support Files/RZLauncher/RZLauncher-prefix.pch"; 317 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 318 | OTHER_LDFLAGS = ""; 319 | OTHER_LIBTOOLFLAGS = ""; 320 | PRIVATE_HEADERS_FOLDER_PATH = ""; 321 | PRODUCT_MODULE_NAME = RZLauncher; 322 | PRODUCT_NAME = RZLauncher; 323 | PUBLIC_HEADERS_FOLDER_PATH = ""; 324 | SDKROOT = iphoneos; 325 | SKIP_INSTALL = YES; 326 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | }; 329 | name = Debug; 330 | }; 331 | 16B1AE228033C4B347AA500F979CBE32 /* Release */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = 9A06B2CBC7F57E9BE08460BE730B397B /* Pods-Example.release.xcconfig */; 334 | buildSettings = { 335 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 336 | CLANG_ENABLE_OBJC_WEAK = NO; 337 | CODE_SIGN_IDENTITY = "iPhone Developer"; 338 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 340 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 341 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 342 | MACH_O_TYPE = staticlib; 343 | OTHER_LDFLAGS = ""; 344 | OTHER_LIBTOOLFLAGS = ""; 345 | PODS_ROOT = "$(SRCROOT)"; 346 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 347 | SDKROOT = iphoneos; 348 | SKIP_INSTALL = YES; 349 | TARGETED_DEVICE_FAMILY = "1,2"; 350 | VALIDATE_PRODUCT = YES; 351 | }; 352 | name = Release; 353 | }; 354 | 4DBC7BEB26003495B559A884D766BF09 /* Debug */ = { 355 | isa = XCBuildConfiguration; 356 | baseConfigurationReference = 873CDB2CE2AB3D55E7F7846B54D0067E /* Pods-Example.debug.xcconfig */; 357 | buildSettings = { 358 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 359 | CLANG_ENABLE_OBJC_WEAK = NO; 360 | CODE_SIGN_IDENTITY = "iPhone Developer"; 361 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 363 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 364 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 365 | MACH_O_TYPE = staticlib; 366 | OTHER_LDFLAGS = ""; 367 | OTHER_LIBTOOLFLAGS = ""; 368 | PODS_ROOT = "$(SRCROOT)"; 369 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 370 | SDKROOT = iphoneos; 371 | SKIP_INSTALL = YES; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | 939F1A8F6BCEB7F9F64D9EEE50CAE014 /* Debug */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_ANALYZER_NONNULL = YES; 381 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 383 | CLANG_CXX_LIBRARY = "libc++"; 384 | CLANG_ENABLE_MODULES = YES; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_ENABLE_OBJC_WEAK = YES; 387 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 388 | CLANG_WARN_BOOL_CONVERSION = YES; 389 | CLANG_WARN_COMMA = YES; 390 | CLANG_WARN_CONSTANT_CONVERSION = YES; 391 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 392 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 393 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 394 | CLANG_WARN_EMPTY_BODY = YES; 395 | CLANG_WARN_ENUM_CONVERSION = YES; 396 | CLANG_WARN_INFINITE_RECURSION = YES; 397 | CLANG_WARN_INT_CONVERSION = YES; 398 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 399 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 400 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 401 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 402 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 403 | CLANG_WARN_STRICT_PROTOTYPES = YES; 404 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 405 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 406 | CLANG_WARN_UNREACHABLE_CODE = YES; 407 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 408 | COPY_PHASE_STRIP = NO; 409 | DEBUG_INFORMATION_FORMAT = dwarf; 410 | ENABLE_STRICT_OBJC_MSGSEND = YES; 411 | ENABLE_TESTABILITY = YES; 412 | GCC_C_LANGUAGE_STANDARD = gnu11; 413 | GCC_DYNAMIC_NO_PIC = NO; 414 | GCC_NO_COMMON_BLOCKS = YES; 415 | GCC_OPTIMIZATION_LEVEL = 0; 416 | GCC_PREPROCESSOR_DEFINITIONS = ( 417 | "POD_CONFIGURATION_DEBUG=1", 418 | "DEBUG=1", 419 | "$(inherited)", 420 | ); 421 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 422 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 423 | GCC_WARN_UNDECLARED_SELECTOR = YES; 424 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 425 | GCC_WARN_UNUSED_FUNCTION = YES; 426 | GCC_WARN_UNUSED_VARIABLE = YES; 427 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 428 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 429 | MTL_FAST_MATH = YES; 430 | ONLY_ACTIVE_ARCH = YES; 431 | PRODUCT_NAME = "$(TARGET_NAME)"; 432 | STRIP_INSTALLED_PRODUCT = NO; 433 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 434 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 435 | SWIFT_VERSION = 5.0; 436 | SYMROOT = "${SRCROOT}/../build"; 437 | }; 438 | name = Debug; 439 | }; 440 | CDD2473C0897B962180C926C0F172C88 /* Release */ = { 441 | isa = XCBuildConfiguration; 442 | baseConfigurationReference = 6B4092BC115674C2A278ED7F9C594F9D /* RZLauncher.xcconfig */; 443 | buildSettings = { 444 | CODE_SIGN_IDENTITY = "iPhone Developer"; 445 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 446 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 447 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 448 | GCC_PREFIX_HEADER = "Target Support Files/RZLauncher/RZLauncher-prefix.pch"; 449 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 450 | OTHER_LDFLAGS = ""; 451 | OTHER_LIBTOOLFLAGS = ""; 452 | PRIVATE_HEADERS_FOLDER_PATH = ""; 453 | PRODUCT_MODULE_NAME = RZLauncher; 454 | PRODUCT_NAME = RZLauncher; 455 | PUBLIC_HEADERS_FOLDER_PATH = ""; 456 | SDKROOT = iphoneos; 457 | SKIP_INSTALL = YES; 458 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 459 | TARGETED_DEVICE_FAMILY = "1,2"; 460 | VALIDATE_PRODUCT = YES; 461 | }; 462 | name = Release; 463 | }; 464 | ECB437504DF805BD96CAABF97400B526 /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | ALWAYS_SEARCH_USER_PATHS = NO; 468 | CLANG_ANALYZER_NONNULL = YES; 469 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 470 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 471 | CLANG_CXX_LIBRARY = "libc++"; 472 | CLANG_ENABLE_MODULES = YES; 473 | CLANG_ENABLE_OBJC_ARC = YES; 474 | CLANG_ENABLE_OBJC_WEAK = YES; 475 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 476 | CLANG_WARN_BOOL_CONVERSION = YES; 477 | CLANG_WARN_COMMA = YES; 478 | CLANG_WARN_CONSTANT_CONVERSION = YES; 479 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 480 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 481 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 482 | CLANG_WARN_EMPTY_BODY = YES; 483 | CLANG_WARN_ENUM_CONVERSION = YES; 484 | CLANG_WARN_INFINITE_RECURSION = YES; 485 | CLANG_WARN_INT_CONVERSION = YES; 486 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 487 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 488 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 489 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 490 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 491 | CLANG_WARN_STRICT_PROTOTYPES = YES; 492 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 493 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 494 | CLANG_WARN_UNREACHABLE_CODE = YES; 495 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 496 | COPY_PHASE_STRIP = NO; 497 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 498 | ENABLE_NS_ASSERTIONS = NO; 499 | ENABLE_STRICT_OBJC_MSGSEND = YES; 500 | GCC_C_LANGUAGE_STANDARD = gnu11; 501 | GCC_NO_COMMON_BLOCKS = YES; 502 | GCC_PREPROCESSOR_DEFINITIONS = ( 503 | "POD_CONFIGURATION_RELEASE=1", 504 | "$(inherited)", 505 | ); 506 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 507 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 508 | GCC_WARN_UNDECLARED_SELECTOR = YES; 509 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 510 | GCC_WARN_UNUSED_FUNCTION = YES; 511 | GCC_WARN_UNUSED_VARIABLE = YES; 512 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 513 | MTL_ENABLE_DEBUG_INFO = NO; 514 | MTL_FAST_MATH = YES; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | STRIP_INSTALLED_PRODUCT = NO; 517 | SWIFT_COMPILATION_MODE = wholemodule; 518 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 519 | SWIFT_VERSION = 5.0; 520 | SYMROOT = "${SRCROOT}/../build"; 521 | }; 522 | name = Release; 523 | }; 524 | /* End XCBuildConfiguration section */ 525 | 526 | /* Begin XCConfigurationList section */ 527 | 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 939F1A8F6BCEB7F9F64D9EEE50CAE014 /* Debug */, 531 | ECB437504DF805BD96CAABF97400B526 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | AAC8714F1B0D4D6F8F923ED2FD859320 /* Build configuration list for PBXNativeTarget "RZLauncher" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | 0516847F72E540967716D85C04F0F047 /* Debug */, 540 | CDD2473C0897B962180C926C0F172C88 /* Release */, 541 | ); 542 | defaultConfigurationIsVisible = 0; 543 | defaultConfigurationName = Release; 544 | }; 545 | C349C5F12485B01EE1C6674739B63B43 /* Build configuration list for PBXNativeTarget "Pods-Example" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | 4DBC7BEB26003495B559A884D766BF09 /* Debug */, 549 | 16B1AE228033C4B347AA500F979CBE32 /* Release */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | /* End XCConfigurationList section */ 555 | }; 556 | rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; 557 | } 558 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/tingdongli.xcuserdatad/xcschemes/Pods-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/tingdongli.xcuserdatad/xcschemes/RZLauncher.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/tingdongli.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-Example.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | RZLauncher.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | 22 | SuppressBuildableAutocreation 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/Map/RZMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/19. 6 | // 7 | 8 | #import 9 | #import "RZMapNode.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface RZMap : NSObject 14 | @property(nonatomic, strong) NSArray *nodes; 15 | 16 | - (RZMapNode *)findMapNodeByValue:(NSString *)valueStr; 17 | - (BOOL)detectCircle; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/Map/RZMap.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/19. 6 | // 7 | 8 | #import "RZMap.h" 9 | 10 | @implementation RZMap 11 | 12 | - (RZMapNode *)findMapNodeByValue:(NSString *)valueStr{ 13 | return [self p_findMapNodeByValue:valueStr inArray:self.nodes]; 14 | } 15 | 16 | - (BOOL)detectCircle{ 17 | BOOL containsCircle = NO; 18 | NSMutableArray *nodeArr = [NSMutableArray arrayWithArray:self.nodes]; 19 | do { 20 | BOOL canFindNoPredecessorNode = [self p_findNoPredecessorsNodeAndDeleteInArray:nodeArr]; 21 | 22 | if (nodeArr.count == 0) { 23 | break; 24 | } 25 | 26 | if (!canFindNoPredecessorNode && nodeArr.count > 0) { 27 | containsCircle = YES; 28 | break; 29 | } 30 | 31 | } while (true); 32 | 33 | return containsCircle; 34 | } 35 | 36 | - (BOOL)p_findNoPredecessorsNodeAndDeleteInArray:(NSMutableArray *)nodeArr { 37 | NSInteger index = [nodeArr indexOfObjectPassingTest:^BOOL(RZMapNode * _Nonnull node, NSUInteger idx, BOOL * _Nonnull stop) { 38 | return node.predecessors.count == 0; 39 | }]; 40 | 41 | if (index == NSNotFound) { 42 | return NO; 43 | } 44 | 45 | RZMapNode *node = [nodeArr objectAtIndex:index]; 46 | if (node.successors.count > 0) { 47 | for (NSString *successor in node.successors) { 48 | RZMapNode *successorNode = [self p_findMapNodeByValue:successor inArray:nodeArr]; 49 | if (successorNode && [successorNode.predecessors containsObject:node.valueStr]) { 50 | [successorNode.predecessors removeObject:node.valueStr]; 51 | } 52 | } 53 | } 54 | [nodeArr removeObject:node]; 55 | return YES; 56 | } 57 | 58 | - (RZMapNode *)p_findMapNodeByValue:(NSString *)valueStr inArray:(NSArray *)nodeArr { 59 | NSInteger index = [nodeArr indexOfObjectPassingTest:^BOOL(RZMapNode * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 60 | return [valueStr isEqualToString:obj.valueStr]; 61 | }]; 62 | 63 | return index == NSNotFound ? nil : [nodeArr objectAtIndex:index]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/Map/RZMapNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/18. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface RZMapNode : NSObject 13 | @property(nonatomic, strong) NSMutableArray *predecessors; 14 | @property(nonatomic, strong) NSMutableArray *successors; 15 | @property(nonatomic, strong) NSString *valueStr; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/Map/RZMapNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/18. 6 | // 7 | 8 | #import "RZMapNode.h" 9 | 10 | @implementation RZMapNode 11 | 12 | - (instancetype)init 13 | { 14 | self = [super init]; 15 | if (self) { 16 | _predecessors = [NSMutableArray array]; 17 | _successors = [NSMutableArray array]; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZAppLaunchBaseTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchBaseTask.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/5/15. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface RZAppLaunchBaseTask : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZAppLaunchBaseTask.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchBaseTask.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/5/15. 6 | // 7 | 8 | #import "RZAppLaunchBaseTask.h" 9 | 10 | @interface RZAppLaunchBaseTask () 11 | @property(nonatomic, assign) CFAbsoluteTime operateTime; 12 | @end 13 | 14 | @implementation RZAppLaunchBaseTask 15 | 16 | - (BOOL)runForLaunchLife:(NSInteger)life { 17 | return YES; 18 | } 19 | 20 | - (RZLaunchPriority)priorityForLaunchLife:(NSInteger)life{ 21 | return RZLaunchPriority_Auto; 22 | } 23 | 24 | - (void)operateBeforeRunLaunchLife:(NSInteger)life{ 25 | self.operateTime = CFAbsoluteTimeGetCurrent(); 26 | } 27 | 28 | - (void)operateAfterRunLaunchLife:(NSInteger)life{ 29 | self.operateTime = CFAbsoluteTimeGetCurrent() - self.operateTime; 30 | } 31 | 32 | - (CFAbsoluteTime)getOperateTime{ 33 | return _operateTime; 34 | } 35 | 36 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life{ 37 | return NO; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZLaunchContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZLaunchContext.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface RZLaunchContext : NSObject 14 | 15 | @property (nonatomic, strong) UIApplication* application; 16 | @property (nonatomic, strong) NSDictionary* launchOptions; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZLaunchContext.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZLaunchContext.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import "RZLaunchContext.h" 9 | 10 | @implementation RZLaunchContext 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZLaunchProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZLaunchProtocol.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import 9 | 10 | typedef NS_ENUM(NSInteger, RZLaunchLife) { 11 | RZLaunchLife_Load = 0, 12 | RZLaunchLife_Constructor, 13 | RZLaunchLife_WillFinishLaunching, 14 | RZLaunchLife_DidFinishLaunchingBeforeHomeRender, 15 | RZLaunchLife_DidFinishLaunchingAfterHomeRender, 16 | RZLaunchLife_TaskAfterLaunching, 17 | RZLaunchLife_AppInitialization, 18 | RZLaunchLife_DidBecomeActive, 19 | RZLaunchLife_WillEnterForeground, 20 | RZLaunchLife_DidEnterBackground, 21 | RZLaunchLife_WillResignActive, 22 | RZLaunchLife_HomePageDidAppear, 23 | RZLaunchLife_HomePageDidActive, 24 | RZLaunchLife_Min = RZLaunchLife_Load, 25 | RZLaunchLife_Max = RZLaunchLife_HomePageDidActive, 26 | }; 27 | 28 | typedef NS_ENUM(NSInteger, RZLaunchThread) { 29 | RZLaunchThread_Main, 30 | RZLaunchThread_Work, 31 | RZLaunchThread_RunLoopWaiting //runloop 空闲 32 | }; 33 | 34 | typedef NS_ENUM(NSInteger, RZLaunchPriority) { 35 | RZLaunchPriority_Auto = 0, 36 | RZLaunchPriority_Low = -1, 37 | RZLaunchPriority_High = 1, 38 | }; 39 | 40 | NS_ASSUME_NONNULL_BEGIN 41 | 42 | @protocol RZLaunchProtocol 43 | 44 | /* 45 | * 任务执行之前的操作 46 | * @param life 生命周期 47 | */ 48 | - (void)operateBeforeRunLaunchLife:(NSInteger)life; 49 | /* 50 | * 指定每个生命周期需要执行的操作 51 | * @param life 生命周期 52 | */ 53 | - (BOOL)runForLaunchLife:(NSInteger)life; 54 | /* 55 | * 任务执行之后的操作 56 | * @param life 生命周期 57 | */ 58 | - (void)operateAfterRunLaunchLife:(NSInteger)life; 59 | 60 | /* 61 | * 获取任务执行的时间 62 | * @param life 生命周期 63 | */ 64 | - (CFAbsoluteTime)getOperateTime; 65 | /* 66 | * 是否立即执行,若为否,会先加入队列,然后执行 67 | * @param life 生命周期 68 | */ 69 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life; 70 | 71 | @optional 72 | 73 | /* 74 | * 指定启动任务的前驱,前驱完成后再执行该任务 75 | * @param life 生命周期 76 | */ 77 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life; 78 | 79 | /* 80 | * 指定启动任务的执行优先级 81 | * @param life 生命周期 82 | */ 83 | - (RZLaunchPriority)priorityForLaunchLife:(NSInteger)life; 84 | 85 | /* 86 | * 指定实例对象 87 | */ 88 | + (instancetype)launcher; 89 | 90 | /* 91 | * 指定启动任务的执行线程 92 | * @param life 生命周期 93 | */ 94 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life; 95 | 96 | @end 97 | 98 | NS_ASSUME_NONNULL_END 99 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZLauncher.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZLauncher.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import 9 | #import "RZLaunchProtocol.h" 10 | #import "RZLaunchContext.h" 11 | 12 | #define RZL_ADD_SECTION_DATA(sectname) __attribute((used, section("__DATA," #sectname " "))) 13 | 14 | #define RZLAUNCH_REGISTER(task) \ 15 | char* k##task##_register RZL_ADD_SECTION_DATA(RZLauncher) = "" #task ""; 16 | 17 | #define RZLocalLaunchConfigName @"RZLaunchTask" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | extern NSArray* RZLaunchLoadConfiguration(const char* sectionName); 22 | 23 | @interface RZLauncher : NSObject 24 | 25 | @property (nonatomic, strong) RZLaunchContext* context; 26 | 27 | + (instancetype)sharedLauncher; 28 | - (void)onTrigger:(NSInteger)type; 29 | - (NSDictionary *)getLaunchTaskReport; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | 35 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZLauncher.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZLauncher.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import "RZLauncher.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #import 15 | #import 16 | #import "RZMap.h" 17 | 18 | const char* kRZLauncherSectionName = "RZLauncher"; 19 | const NSInteger RZMaxConcurrentOperationCount = 6; 20 | 21 | NSArray* RZLaunchLoadConfiguration(const char* sectionName) 22 | { 23 | NSMutableArray* configs = [NSMutableArray array]; 24 | 25 | Dl_info info; 26 | dladdr(RZLaunchLoadConfiguration, &info); 27 | 28 | #ifndef __LP64__ 29 | const struct mach_header* mhp = (struct mach_header*)info.dli_fbase; 30 | unsigned long size = 0; 31 | uint32_t* memory = (uint32_t*)getsectiondata(mhp, SEG_DATA, sectionName, &size); 32 | #else /* defined(__LP64__) */ 33 | const struct mach_header_64* mhp = (struct mach_header_64*)info.dli_fbase; 34 | unsigned long size = 0; 35 | uint64_t* memory = (uint64_t*)getsectiondata(mhp, SEG_DATA, sectionName, &size); 36 | #endif /* defined(__LP64__) */ 37 | 38 | unsigned long counter = size / sizeof(void*); 39 | for (int idx = 0; idx < counter; ++idx) { 40 | char* string = (char*)memory[idx]; 41 | @autoreleasepool { 42 | NSString *configName = [NSString stringWithUTF8String:string]; 43 | if (configName) { 44 | [configs addObject:configName]; 45 | } 46 | } 47 | } 48 | 49 | return configs; 50 | } 51 | 52 | __attribute__((constructor)) static void constructRZLauncher(void) 53 | { 54 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_Constructor]; 55 | } 56 | 57 | @interface RZLauncher () { 58 | NSMutableArray>* _launchTasks; 59 | NSMutableDictionary *_launchTaskReportDict; 60 | NSLock *_lock; 61 | NSLock *_blockOperationLock; 62 | NSOperationQueue *_commonConcurrentQueue; 63 | NSMutableDictionary *_launchTaskOperationDict; 64 | NSDictionary *_localPlistLaunchTasksDict; 65 | } 66 | 67 | @end 68 | 69 | @implementation RZLauncher 70 | 71 | + (void)load 72 | { 73 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_Load]; 74 | } 75 | 76 | + (instancetype)sharedLauncher 77 | { 78 | static dispatch_once_t onceToken; 79 | static RZLauncher* launcher; 80 | dispatch_once(&onceToken, ^{ 81 | launcher = [[self alloc] init]; 82 | NSArray* registerTaskNames = RZLaunchLoadConfiguration(kRZLauncherSectionName); 83 | NSArray* LocalPlistLaunchTaskNames = [launcher loadLocalLaunchTasks]; 84 | NSMutableArray *taskNames = [NSMutableArray array]; 85 | [taskNames addObjectsFromArray:registerTaskNames]; 86 | [taskNames addObjectsFromArray:LocalPlistLaunchTaskNames]; 87 | 88 | for (NSString* name in taskNames) { 89 | [launcher registerLaunchTaskName:name]; 90 | } 91 | }); 92 | return launcher; 93 | } 94 | 95 | - (instancetype)init 96 | { 97 | self = [super init]; 98 | if (self) { 99 | _launchTasks = [NSMutableArray array]; 100 | _launchTaskReportDict = [NSMutableDictionary dictionary]; 101 | _lock = [[NSLock alloc] init]; 102 | _commonConcurrentQueue = [[NSOperationQueue alloc] init]; 103 | _commonConcurrentQueue.maxConcurrentOperationCount = RZMaxConcurrentOperationCount; 104 | _launchTaskOperationDict = [NSMutableDictionary dictionary]; 105 | _blockOperationLock = [[NSLock alloc] init]; 106 | } 107 | 108 | return self; 109 | } 110 | 111 | - (NSArray *)loadLocalLaunchTasks 112 | { 113 | 114 | NSString *plistPath = [[NSBundle mainBundle] pathForResource:RZLocalLaunchConfigName ofType:@"plist"]; 115 | if (![[NSFileManager defaultManager] fileExistsAtPath:plistPath]) { 116 | return @[]; 117 | } 118 | 119 | _localPlistLaunchTasksDict = [[NSDictionary alloc] initWithContentsOfFile:plistPath]; 120 | 121 | NSArray *launchTasks = _localPlistLaunchTasksDict.allKeys; 122 | 123 | if (launchTasks && launchTasks.count > 0) { 124 | return launchTasks; 125 | } 126 | 127 | return @[]; 128 | } 129 | 130 | - (void)registerLaunchTaskName:(NSString*)name 131 | { 132 | Class taskClass = NSClassFromString(name); 133 | NSAssert([taskClass conformsToProtocol:@protocol(RZLaunchProtocol)], @"%@ does not conform to RZLaunchProtocol", name); 134 | 135 | if ([taskClass conformsToProtocol:@protocol(RZLaunchProtocol)]) { 136 | id task = nil; 137 | if ([taskClass respondsToSelector:@selector(launcher)]) { 138 | task = [taskClass launcher]; 139 | } else { 140 | task = [[taskClass alloc] init]; 141 | } 142 | if (task) { 143 | [_launchTasks addObject:task]; 144 | } 145 | } 146 | } 147 | 148 | - (void)registerBlockOperationsWithLaunchLife:(NSInteger)launchLiftIndex{ 149 | 150 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull task, NSUInteger idx, BOOL * _Nonnull stop) { 151 | if (![task runImmediatelyForLaunchLife:launchLiftIndex]) { 152 | [self registerBlockWithTask:task withLaunchLife:launchLiftIndex]; 153 | } 154 | }]; 155 | } 156 | 157 | 158 | - (void)registerBlockWithTask:(id)task withLaunchLife:(NSInteger)launchLiftIndex{ 159 | NSMutableDictionary *runLiftOperationDict = [NSMutableDictionary dictionary]; 160 | NSString *taskKey = NSStringFromClass(task.class); 161 | if ([_launchTaskOperationDict.allKeys containsObject:taskKey]) { 162 | [runLiftOperationDict addEntriesFromDictionary:[_launchTaskOperationDict objectForKey:taskKey]]; 163 | } 164 | __weak typeof(self) weakSelf = self; 165 | NSBlockOperation *liftOperation = [NSBlockOperation blockOperationWithBlock:^{ 166 | if (weakSelf) { 167 | [weakSelf p_checkOperateBeforeAndRunWithTask:task launchLife:launchLiftIndex]; 168 | } 169 | [task runForLaunchLife:launchLiftIndex]; 170 | if (weakSelf) { 171 | [weakSelf p_checkOperateAfterAndRunWithTask:task launchLife:launchLiftIndex]; 172 | } 173 | }]; 174 | if (liftOperation) { 175 | [runLiftOperationDict setObject:liftOperation forKey:@(launchLiftIndex)]; 176 | } 177 | 178 | [_blockOperationLock lock]; 179 | [_launchTaskOperationDict setValue:runLiftOperationDict.copy forKey:taskKey]; 180 | [_blockOperationLock unlock]; 181 | } 182 | 183 | - (void)onTrigger:(NSInteger)type 184 | { 185 | RZMap *map = [self p_creatMapWithLaunchLife:type]; 186 | NSAssert(![map detectCircle], @"启动任务存在循环依赖!"); 187 | if ([map detectCircle]) { 188 | return ; 189 | } 190 | 191 | //生成type对应的BlockOperation 192 | [self registerBlockOperationsWithLaunchLife:type]; 193 | //增加依赖 194 | [self addDependencysWithLaunchLife:type]; 195 | 196 | // 启动流程应该是串型的,所以这里不加锁处理 197 | NSMutableArray>* lowPriorityLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 198 | NSMutableArray>* normalPriorityLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 199 | NSMutableArray>* runloopWaitingLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 200 | NSMutableArray>* deleteLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 201 | [_launchTasks enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 202 | RZLaunchPriority priority = RZLaunchPriority_Auto; 203 | if ([launcher respondsToSelector:@selector(priorityForLaunchLife:)]) { 204 | priority = [launcher priorityForLaunchLife:type]; 205 | } 206 | 207 | switch (priority) { 208 | case RZLaunchPriority_High: 209 | if ([self launchTaskNeedRunWhenRunLoopWaiting:launcher launchLife:type]) { 210 | [runloopWaitingLaunchers addObject:launcher]; 211 | }else{ 212 | [self runForLaunchLife:type forTask:launcher deleteArr:deleteLaunchers]; 213 | } 214 | break; 215 | case RZLaunchPriority_Auto: 216 | [normalPriorityLaunchers addObject:launcher]; 217 | break; 218 | case RZLaunchPriority_Low: 219 | [lowPriorityLaunchers addObject:launcher]; 220 | break; 221 | default: 222 | break; 223 | } 224 | }]; 225 | if (normalPriorityLaunchers.count > 0) { 226 | [normalPriorityLaunchers enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 227 | if ([self launchTaskNeedRunWhenRunLoopWaiting:launcher launchLife:type]) { 228 | [runloopWaitingLaunchers addObject:launcher]; 229 | }else{ 230 | [self runForLaunchLife:type forTask:launcher deleteArr:deleteLaunchers]; 231 | } 232 | }]; 233 | } 234 | if (lowPriorityLaunchers.count > 0) { 235 | [lowPriorityLaunchers enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 236 | if ([self launchTaskNeedRunWhenRunLoopWaiting:launcher launchLife:type]) { 237 | [runloopWaitingLaunchers addObject:launcher]; 238 | }else{ 239 | [self runForLaunchLife:type forTask:launcher deleteArr:deleteLaunchers]; 240 | } 241 | }]; 242 | } 243 | 244 | //runloop空闲执行 245 | if (runloopWaitingLaunchers && runloopWaitingLaunchers.count > 0) { 246 | CFRunLoopRef runLoop = CFRunLoopGetCurrent(); 247 | CFStringRef runLoopMode = kCFRunLoopDefaultMode; 248 | CFRunLoopObserverRef observer = CFRunLoopObserverCreateWithHandler(kCFAllocatorDefault, kCFRunLoopBeforeWaiting, true, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity _) { 249 | [runloopWaitingLaunchers enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 250 | 251 | if ([launcher runImmediatelyForLaunchLife:type]) { 252 | [self p_checkOperateBeforeAndRunWithTask:launcher launchLife:type]; 253 | [launcher runForLaunchLife:type]; 254 | [self p_checkOperateAfterAndRunWithTask:launcher launchLife:type]; 255 | }else{ 256 | NSDictionary *runThisTaskLifeOperationDict = [self->_launchTaskOperationDict objectForKey:NSStringFromClass(launcher.class)]; 257 | NSBlockOperation *runThisTaskLifeOperation = [runThisTaskLifeOperationDict objectForKey:@(type)]; 258 | 259 | if (runThisTaskLifeOperation) { 260 | [[NSOperationQueue mainQueue] addOperation:runThisTaskLifeOperation]; 261 | } 262 | } 263 | 264 | }]; 265 | CFRunLoopRemoveObserver(runLoop, observer, runLoopMode); 266 | CFRelease(observer); 267 | }); 268 | CFRunLoopAddObserver(runLoop, observer, runLoopMode); 269 | } 270 | 271 | 272 | 273 | if (deleteLaunchers.count > 0) { 274 | [_launchTasks removeObjectsInArray:deleteLaunchers]; 275 | } 276 | } 277 | 278 | - (void)runForLaunchLife:(NSInteger)type forTask:(id)task deleteArr:(NSMutableArray>*)deleteArr{ 279 | RZLaunchThread launchThread = RZLaunchThread_Main; 280 | if ([task respondsToSelector:@selector(runInThreadForLaunchLife:)]) { 281 | launchThread = [task runInThreadForLaunchLife:type]; 282 | } 283 | 284 | NSDictionary *runThisTaskLifeOperationDict = [_launchTaskOperationDict objectForKey:NSStringFromClass(task.class)]; 285 | NSBlockOperation *runThisTaskLifeOperation = [runThisTaskLifeOperationDict objectForKey:@(type)]; 286 | 287 | if (launchThread == RZLaunchThread_Work) { 288 | if (runThisTaskLifeOperation) { 289 | [_commonConcurrentQueue addOperation:runThisTaskLifeOperation]; 290 | } 291 | }else{ 292 | //主线程 293 | if ([task runImmediatelyForLaunchLife:type]) { 294 | //需要立即执行 295 | [self p_checkOperateBeforeAndRunWithTask:task launchLife:type]; 296 | [task runForLaunchLife:type]; 297 | [self p_checkOperateAfterAndRunWithTask:task launchLife:type]; 298 | }else{ 299 | if (runThisTaskLifeOperation) { 300 | [[NSOperationQueue mainQueue] addOperation:runThisTaskLifeOperation]; 301 | } 302 | } 303 | } 304 | } 305 | 306 | - (void)addDependencysWithLaunchLife:(NSInteger)launchLifeIndex{ 307 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 308 | if ([self p_getPredecessorsForTask:obj forLaunchLife:launchLifeIndex]) { 309 | NSArray *runPredecessors = [self p_getPredecessorsForTask:obj forLaunchLife:launchLifeIndex]; 310 | if (runPredecessors && runPredecessors.count > 0) { 311 | NSDictionary *runThisTaskLifeOperationDict = [_launchTaskOperationDict objectForKey:NSStringFromClass(obj.class)]; 312 | NSBlockOperation *runThisTaskLifeOperation = [runThisTaskLifeOperationDict objectForKey:@(launchLifeIndex)]; 313 | for (NSString *runPredecessorName in runPredecessors) { 314 | NSDictionary *runPredecessorTaskLifeOperationDict = [_launchTaskOperationDict objectForKey:runPredecessorName]; 315 | NSBlockOperation *runPredecessorTaskLifeOperation = [runPredecessorTaskLifeOperationDict objectForKey:@(launchLifeIndex)]; 316 | if (runPredecessorTaskLifeOperation) { 317 | [runThisTaskLifeOperation addDependency:runPredecessorTaskLifeOperation]; 318 | } 319 | } 320 | } 321 | } 322 | }]; 323 | } 324 | 325 | - (BOOL)launchTaskNeedRunWhenRunLoopWaiting:(id)task launchLife:(NSInteger)type{ 326 | return [task respondsToSelector:@selector(runInThreadForLaunchLife:)] && [task runInThreadForLaunchLife:type] == RZLaunchThread_RunLoopWaiting; 327 | } 328 | 329 | 330 | - (NSDictionary *)getLaunchTaskReport{ 331 | return _launchTaskReportDict.copy; 332 | } 333 | 334 | 335 | #pragma mark private method 336 | - (void)p_checkOperateBeforeAndRunWithTask:(id)task launchLife:(NSInteger)type{ 337 | if ([task respondsToSelector:@selector(operateBeforeRunLaunchLife:)]) { 338 | [task operateBeforeRunLaunchLife:type]; 339 | } 340 | } 341 | 342 | - (void)p_checkOperateAfterAndRunWithTask:(id)task launchLife:(NSInteger)type{ 343 | if ([task respondsToSelector:@selector(operateAfterRunLaunchLife:)]) { 344 | [task operateAfterRunLaunchLife:type]; 345 | [self p_addToReportDictByTask:task launchLife:type]; 346 | } 347 | } 348 | 349 | - (void)p_addToReportDictByTask:(id)task launchLife:(NSInteger)type{ 350 | if (type == RZLaunchLife_DidFinishLaunchingBeforeHomeRender || type == RZLaunchLife_DidFinishLaunchingAfterHomeRender) { 351 | if ([task respondsToSelector:@selector(getOperateTime)]) { 352 | NSString *operateTimeStr = [NSString stringWithFormat:@"%lf", [task getOperateTime]]; 353 | [_lock lock]; 354 | [_launchTaskReportDict setValue:operateTimeStr forKey:NSStringFromClass(task.class)]; 355 | [_lock unlock]; 356 | } 357 | } 358 | } 359 | 360 | - (NSArray *)p_getPredecessorsForTask:(id)task forLaunchLife:(NSInteger)life{ 361 | if ([task respondsToSelector:@selector(runPredecessorsForLaunchLife:)]) { 362 | NSArray *predecessors = [task runPredecessorsForLaunchLife:life]; 363 | if (predecessors && predecessors.count > 0) { 364 | return predecessors; 365 | } 366 | } 367 | 368 | NSDictionary *lifePredecessorsDict = [_localPlistLaunchTasksDict objectForKey:NSStringFromClass(task.class)]; 369 | NSString *liftStrKey = [NSString stringWithFormat:@"%@", @(life)]; 370 | id lifePredecessors = [lifePredecessorsDict objectForKey: liftStrKey]; 371 | if ([lifePredecessors isKindOfClass:[NSArray class]]) { 372 | NSArray *tLifePredecessors = lifePredecessors; 373 | if (tLifePredecessors && tLifePredecessors.count > 0) { 374 | return tLifePredecessors; 375 | } 376 | } 377 | 378 | return nil; 379 | } 380 | 381 | #pragma mark Map 382 | 383 | - (RZMap *)p_creatMapWithLaunchLife:(NSInteger)type{ 384 | RZMap *map = [[RZMap alloc] init]; 385 | NSMutableArray *mapNodeArr = [NSMutableArray array]; 386 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 387 | RZMapNode *node = [[RZMapNode alloc] init]; 388 | node.valueStr = NSStringFromClass(obj.class); 389 | 390 | if ([self p_getPredecessorsForTask:obj forLaunchLife:type]) { 391 | NSArray *predecessors = [self p_getPredecessorsForTask:obj forLaunchLife:type]; 392 | if (predecessors && predecessors.count > 0) { 393 | [node.predecessors addObjectsFromArray:predecessors]; 394 | } 395 | } 396 | [mapNodeArr addObject:node]; 397 | }]; 398 | map.nodes = mapNodeArr.copy; 399 | 400 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 401 | if ([self p_getPredecessorsForTask:obj forLaunchLife:type]) { 402 | NSArray *predecessors = [self p_getPredecessorsForTask:obj forLaunchLife:type]; 403 | if (predecessors && predecessors.count > 0) { 404 | for (NSString *predecessor in predecessors) { 405 | RZMapNode *node = [map findMapNodeByValue:predecessor]; 406 | if (node) { 407 | [node.successors addObject:NSStringFromClass(obj.class)]; 408 | } 409 | } 410 | } 411 | } 412 | }]; 413 | return map; 414 | } 415 | 416 | @end 417 | 418 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZModuleBaseProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleBaseProtocol.h 3 | // 4 | // Created by tingdongli on 2019/7/24. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #ifndef RZModuleBaseProtocol_h 9 | #define RZModuleBaseProtocol_h 10 | 11 | @protocol RZModuleBaseProtocol 12 | 13 | @optional 14 | - (id)unitTest; 15 | 16 | @end 17 | 18 | #endif /* RZModuleBaseProtocol */ 19 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZModuleMediator.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleMediator.h 3 | // 4 | // Created by tingdongli on 2019/7/24. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "RZModuleBaseProtocol.h" 10 | #import "RZModuleRegister.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface RZModuleMediator : NSObject 15 | 16 | + (instancetype)sharedInstance; 17 | 18 | //注册类 19 | - (void)registerProtocol:(Protocol*)protocol forClass:(Class)cls; 20 | - (Class)classForProtocol:(Protocol*)protocol; 21 | 22 | //接口的实现类 23 | - (id)implForProtocol:(Protocol*)protocol; 24 | 25 | + (id)implObjForProtocol:(Protocol*)protocol; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZModuleMediator.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleMediator.m 3 | // 4 | // Created by tingdongli on 2019/7/24. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import "RZModuleMediator.h" 9 | 10 | @interface RZModuleMediator () { 11 | NSLock* _lock; 12 | } 13 | 14 | @property (nonatomic, strong) NSMutableDictionary* protocolCache; 15 | @property (nonatomic, strong) NSMutableDictionary* impObjCache; 16 | 17 | @end 18 | 19 | @implementation RZModuleMediator 20 | 21 | + (instancetype)sharedInstance 22 | { 23 | static RZModuleMediator* mediator = nil; 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | mediator = [[RZModuleMediator alloc] init]; 27 | }); 28 | return mediator; 29 | } 30 | 31 | - (instancetype)init 32 | { 33 | self = [super init]; 34 | if (self) { 35 | self.protocolCache = [NSMutableDictionary dictionary]; 36 | self.impObjCache = [NSMutableDictionary dictionary]; 37 | _lock = [[NSLock alloc] init]; 38 | } 39 | 40 | return self; 41 | } 42 | 43 | /* 44 | * 注册接口,把实现的Class注册到对应的Protocol上 45 | * 调用方根据Protocol查找到对应的Class,然后调用Class的方法 (这里一般是创建Class对象,然后调用这个对象实现的Protocol方法,进而根据接口编程) 46 | * 47 | */ 48 | 49 | - (void)registerProtocol:(Protocol*)protocol forClass:(Class)cls 50 | { 51 | NSAssert(![self classForProtocol:protocol], ([NSString stringWithFormat:@"❌ %@不应该注册两次,请检查...", NSStringFromProtocol(protocol)])); 52 | [self.protocolCache setObject:cls forKey:NSStringFromProtocol(protocol)]; 53 | } 54 | 55 | - (Class)classForProtocol:(Protocol*)protocol 56 | { 57 | return self.protocolCache[NSStringFromProtocol(protocol)]; 58 | } 59 | 60 | - (id)implForProtocol:(Protocol*)protocol 61 | { 62 | NSString* key = NSStringFromProtocol(protocol); 63 | 64 | [_lock lock]; 65 | Class cls = self.protocolCache[key]; 66 | 67 | NSAssert(cls, ([NSString stringWithFormat:@"❌请检查调用的模块(%@)是否注册了实现类!", key])); 68 | 69 | id imp = self.impObjCache[key]; 70 | if (!imp) { 71 | imp = [[cls alloc] init]; 72 | [self.impObjCache setObject:imp forKey:key]; 73 | } 74 | [_lock unlock]; 75 | 76 | NSAssert(imp && [imp conformsToProtocol:protocol], @"❌ImpL 必须要遵从Protocol"); 77 | NSAssert([imp conformsToProtocol:@protocol(RZModuleBaseProtocol)], @"❌ImpL 实现的Protocol必须从QBModuleBaseProtocol继承!"); 78 | 79 | return imp; 80 | } 81 | 82 | + (id)implObjForProtocol:(Protocol*)protocol 83 | { 84 | return [[RZModuleMediator sharedInstance] implForProtocol:protocol]; 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZModuleRegister.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleRegister.h 3 | // 4 | // Created by tingdongli on 2019/8/1. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | #define RZM_ADD_SECTION_DATA(sectname) __attribute((used, section("__DATA," #sectname " "))) 12 | 13 | #define RZM_EXPORT_MODULE_PROTOCOL(protocolName, impl) \ 14 | char* k##protocolName##_service RZM_ADD_SECTION_DATA(RZModuleImpl) = "" #protocolName ":" #impl ""; 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface RZModuleRegister : RZAppLaunchBaseTask 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/Mediator/Classes/RZModuleRegister.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleRegister.m 3 | // 4 | // Created by tingdongli on 2019/8/1. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import "RZModuleRegister.h" 9 | #import "RZModuleMediator.h" 10 | #import "RZLauncher.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #import 17 | #import 18 | 19 | NSArray* BHReadConfiguration(char* sectionName, const struct mach_header* mhp); 20 | 21 | static void dyld_callback(const struct mach_header* mhp, intptr_t vmaddr_slide) 22 | { 23 | NSArray* protocol2Impls = BHReadConfiguration("RZModuleImpl", mhp); 24 | for (NSString* protocol2ImplConfig in protocol2Impls) { 25 | 26 | NSArray* array = [protocol2ImplConfig componentsSeparatedByString:@":"]; 27 | 28 | if (array.count == 2) { 29 | NSString* protocol = array[0]; 30 | NSString* clsName = array[1]; 31 | 32 | if (protocol && clsName) { 33 | [[RZModuleMediator sharedInstance] registerProtocol:NSProtocolFromString(protocol) forClass:NSClassFromString(clsName)]; 34 | } 35 | } 36 | } 37 | } 38 | 39 | NSArray* BHReadConfiguration(char* sectionName, const struct mach_header* mhp) 40 | { 41 | NSMutableArray* configs = [NSMutableArray array]; 42 | unsigned long size = 0; 43 | #ifndef __LP64__ 44 | uintptr_t* memory = (uintptr_t*)getsectiondata(mhp, SEG_DATA, sectionName, &size); 45 | #else 46 | const struct mach_header_64* mhp64 = (const struct mach_header_64*)mhp; 47 | uintptr_t* memory = (uintptr_t*)getsectiondata(mhp64, SEG_DATA, sectionName, &size); 48 | #endif 49 | 50 | unsigned long counter = size / sizeof(void*); 51 | for (int idx = 0; idx < counter; ++idx) { 52 | char* string = (char*)memory[idx]; 53 | NSString* str = [NSString stringWithUTF8String:string]; 54 | if (!str) 55 | continue; 56 | 57 | if (str) 58 | [configs addObject:str]; 59 | } 60 | 61 | return configs; 62 | } 63 | 64 | RZLAUNCH_REGISTER(RZModuleRegister) 65 | 66 | @interface RZModuleRegister () 67 | 68 | @end 69 | 70 | @implementation RZModuleRegister 71 | 72 | - (BOOL)runForLaunchLife:(NSInteger)life 73 | { 74 | if (life == RZLaunchLife_Constructor) { 75 | _dyld_register_func_for_add_image(dyld_callback); 76 | return NO; 77 | } 78 | 79 | return YES; 80 | } 81 | 82 | 83 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life{ 84 | if (life == RZLaunchLife_Constructor) { 85 | return YES; 86 | } 87 | return NO; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Example/Pods/RZLauncher/README.md: -------------------------------------------------------------------------------- 1 | # RZLauncher 2 | 3 | iOS启动框架,支持启动生命周期分发,启动任务分布式注册,启动任务依赖,支持设置启动任务在各生命周期的优先级,执行所在线程以及对其他启动任务的依赖。根据启动任务的依赖关系,检测循环依赖,并发执行,提升启动的效率。同时,统计各启动任务消耗的时间,暴露给外部使用。 4 | 5 | 6 | ## 接入 7 | 8 | ## 使用指南 9 | 10 | ### 1.生命周期分发 11 | 12 | ``` 13 | typedef NS_ENUM(NSInteger, RZLaunchLife) { 14 | RZLaunchLife_Load = 0, 15 | RZLaunchLife_Constructor, 16 | RZLaunchLife_WillFinishLaunching, 17 | RZLaunchLife_DidFinishLaunchingBeforeHomeRender, 18 | RZLaunchLife_DidFinishLaunchingAfterHomeRender, 19 | RZLaunchLife_TaskAfterLaunching, 20 | RZLaunchLife_AppInitialization, 21 | RZLaunchLife_DidBecomeActive, 22 | RZLaunchLife_WillEnterForeground, 23 | RZLaunchLife_DidEnterBackground, 24 | RZLaunchLife_WillResignActive, 25 | RZLaunchLife_HomePageDidAppear, 26 | RZLaunchLife_HomePageDidActive, 27 | RZLaunchLife_Min = RZLaunchLife_Load, 28 | RZLaunchLife_Max = RZLaunchLife_HomePageDidActive, 29 | }; 30 | 31 | ``` 32 | 33 | 在AppDelegate中的启动回调中触发分发,比如: 34 | 35 | ``` 36 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_DidBecomeActive]; 37 | ``` 38 | 39 | ### 2.启动任务注册 40 | 41 | 42 | (1) 继承RZAppLaunchBaseTask,添加宏 RZLAUNCH_REGISTER(RZAppLaunchTaskName)。 43 | 44 | `RZLAUNCH_REGISTER(RZAppLaunchTaskName) ` 45 | 46 | (2) 实现RZLaunchProtocol协议。 47 | 48 | 49 | ``` 50 | 51 | /* 52 | * 任务执行之前的操作 53 | * @param life 生命周期 54 | */ 55 | - (void)operateBeforeRunLaunchLife:(NSInteger)life; 56 | 57 | /* 58 | * 指定每个生命周期需要执行的操作 59 | * @param life 生命周期 60 | */ 61 | - (BOOL)runForLaunchLife:(NSInteger)life; 62 | 63 | /* 64 | * 任务执行之后的操作 65 | * @param life 生命周期 66 | */ 67 | - (void)operateAfterRunLaunchLife:(NSInteger)life; 68 | 69 | /* 70 | * 获取任务执行的时间 71 | * @param life 生命周期 72 | */ 73 | - (CFAbsoluteTime)getOperateTime; 74 | 75 | /* 76 | * 是否立即执行,若为否,会先加入队列,然后执行 77 | * @param life 生命周期 78 | */ 79 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life; 80 | 81 | @optional 82 | 83 | /* 84 | * 指定启动任务的前驱,前驱完成后再执行该任务 85 | * @param life 生命周期 86 | */ 87 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life; 88 | 89 | /* 90 | * 指定启动任务的执行优先级 91 | * @param life 生命周期 92 | */ 93 | - (RZLaunchPriority)priorityForLaunchLife:(NSInteger)life; 94 | 95 | /* 96 | * 指定实例对象 97 | */ 98 | + (instancetype)launcher; 99 | 100 | /* 101 | * 指定启动任务的执行线程 102 | * @param life 生命周期 103 | */ 104 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life; 105 | 106 | 107 | ``` 108 | 109 | 也可以通过plist注册,支持注册任务和配置任务前驱。 110 | 111 | ``` 112 | 113 | RZAppLaunchTask6 114 | 115 | //生命周期的枚举值 116 | 7 117 | 118 | RZAppLaunchTask2 119 | 120 | 121 | RZAppLaunchTask7 122 | 123 | 7 124 | 125 | RZAppLaunchTask2 126 | 127 | 128 | 129 | 130 | 131 | ``` 132 | 133 | 134 | # RZMediator 135 | 136 | iOS中间件,protocol-class映射模式,注册和使用起来简单,实现解耦的目的,搭配RZLauncher使用更佳。 137 | 138 | ## 使用指南 139 | 140 | ### 1.新建protocol,继承RZModuleBaseProtocol,并新建类来实现该protocol。 141 | 142 | ``` 143 | 144 | @protocol TestProtocol 145 | 146 | - (void)test; 147 | 148 | @end 149 | 150 | @interface TestImpl : NSObject 151 | 152 | @end 153 | 154 | ``` 155 | 156 | 157 | ### 2.注册protocol及实现该protocol的类名 158 | 159 | ``` 160 | 161 | RZM_EXPORT_MODULE_PROTOCOL(TestProtocol, TestImpl) 162 | 163 | ``` 164 | 165 | ### 3.使用。 166 | 167 | ``` 168 | [[RZModuleMediator implObjForProtocol: @protocol(TestProtocol)] test]; 169 | ``` 170 | 171 | 172 | 示例: 173 | 174 | ``` 175 | 176 | #import "RZModuleMediator.h" 177 | 178 | @protocol TestProtocol 179 | 180 | - (void)test; 181 | 182 | @end 183 | 184 | @interface TestImpl : NSObject 185 | 186 | @end 187 | 188 | 189 | RZM_EXPORT_MODULE_PROTOCOL(TestProtocol, TestImpl) 190 | 191 | 192 | ``` 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RZLauncher" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RZLauncher" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"RZLauncher" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RZLauncher" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/RZLauncher" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"RZLauncher" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/RZLauncher/RZLauncher-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_RZLauncher : NSObject 3 | @end 4 | @implementation PodsDummy_RZLauncher 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/RZLauncher/RZLauncher-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/RZLauncher/RZLauncher.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/RZLauncher 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RZLauncher" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RZLauncher" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/RZLauncher 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane" 4 | gem 'cocoapods' -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.2) 5 | activesupport (4.2.11.1) 6 | i18n (~> 0.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | addressable (2.7.0) 11 | public_suffix (>= 2.0.2, < 5.0) 12 | algoliasearch (1.27.1) 13 | httpclient (~> 2.8, >= 2.8.3) 14 | json (>= 1.5.1) 15 | atomos (0.1.3) 16 | aws-eventstream (1.0.3) 17 | aws-partitions (1.294.0) 18 | aws-sdk-core (3.92.0) 19 | aws-eventstream (~> 1.0, >= 1.0.2) 20 | aws-partitions (~> 1, >= 1.239.0) 21 | aws-sigv4 (~> 1.1) 22 | jmespath (~> 1.0) 23 | aws-sdk-kms (1.30.0) 24 | aws-sdk-core (~> 3, >= 3.71.0) 25 | aws-sigv4 (~> 1.1) 26 | aws-sdk-s3 (1.61.2) 27 | aws-sdk-core (~> 3, >= 3.83.0) 28 | aws-sdk-kms (~> 1) 29 | aws-sigv4 (~> 1.1) 30 | aws-sigv4 (1.1.1) 31 | aws-eventstream (~> 1.0, >= 1.0.2) 32 | babosa (1.0.3) 33 | claide (1.0.3) 34 | cocoapods (1.8.4) 35 | activesupport (>= 4.0.2, < 5) 36 | claide (>= 1.0.2, < 2.0) 37 | cocoapods-core (= 1.8.4) 38 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 39 | cocoapods-downloader (>= 1.2.2, < 2.0) 40 | cocoapods-plugins (>= 1.0.0, < 2.0) 41 | cocoapods-search (>= 1.0.0, < 2.0) 42 | cocoapods-stats (>= 1.0.0, < 2.0) 43 | cocoapods-trunk (>= 1.4.0, < 2.0) 44 | cocoapods-try (>= 1.1.0, < 2.0) 45 | colored2 (~> 3.1) 46 | escape (~> 0.0.4) 47 | fourflusher (>= 2.3.0, < 3.0) 48 | gh_inspector (~> 1.0) 49 | molinillo (~> 0.6.6) 50 | nap (~> 1.0) 51 | ruby-macho (~> 1.4) 52 | xcodeproj (>= 1.11.1, < 2.0) 53 | cocoapods-core (1.8.4) 54 | activesupport (>= 4.0.2, < 6) 55 | algoliasearch (~> 1.0) 56 | concurrent-ruby (~> 1.1) 57 | fuzzy_match (~> 2.0.4) 58 | nap (~> 1.0) 59 | cocoapods-deintegrate (1.0.4) 60 | cocoapods-downloader (1.3.0) 61 | cocoapods-plugins (1.0.0) 62 | nap 63 | cocoapods-search (1.0.0) 64 | cocoapods-stats (1.1.0) 65 | cocoapods-trunk (1.4.1) 66 | nap (>= 0.8, < 2.0) 67 | netrc (~> 0.11) 68 | cocoapods-try (1.1.0) 69 | colored (1.2) 70 | colored2 (3.1.2) 71 | commander-fastlane (4.4.6) 72 | highline (~> 1.7.2) 73 | concurrent-ruby (1.1.6) 74 | declarative (0.0.10) 75 | declarative-option (0.1.0) 76 | digest-crc (0.5.1) 77 | domain_name (0.5.20190701) 78 | unf (>= 0.0.5, < 1.0.0) 79 | dotenv (2.7.5) 80 | emoji_regex (1.0.1) 81 | escape (0.0.4) 82 | excon (0.73.0) 83 | faraday (0.17.3) 84 | multipart-post (>= 1.2, < 3) 85 | faraday-cookie_jar (0.0.6) 86 | faraday (>= 0.7.4) 87 | http-cookie (~> 1.0.0) 88 | faraday_middleware (0.13.1) 89 | faraday (>= 0.7.4, < 1.0) 90 | fastimage (2.1.7) 91 | fastlane (2.144.0) 92 | CFPropertyList (>= 2.3, < 4.0.0) 93 | addressable (>= 2.3, < 3.0.0) 94 | aws-sdk-s3 (~> 1.0) 95 | babosa (>= 1.0.2, < 2.0.0) 96 | bundler (>= 1.12.0, < 3.0.0) 97 | colored 98 | commander-fastlane (>= 4.4.6, < 5.0.0) 99 | dotenv (>= 2.1.1, < 3.0.0) 100 | emoji_regex (>= 0.1, < 2.0) 101 | excon (>= 0.71.0, < 1.0.0) 102 | faraday (~> 0.17) 103 | faraday-cookie_jar (~> 0.0.6) 104 | faraday_middleware (~> 0.13.1) 105 | fastimage (>= 2.1.0, < 3.0.0) 106 | gh_inspector (>= 1.1.2, < 2.0.0) 107 | google-api-client (>= 0.29.2, < 0.37.0) 108 | google-cloud-storage (>= 1.15.0, < 2.0.0) 109 | highline (>= 1.7.2, < 2.0.0) 110 | json (< 3.0.0) 111 | jwt (~> 2.1.0) 112 | mini_magick (>= 4.9.4, < 5.0.0) 113 | multi_xml (~> 0.5) 114 | multipart-post (~> 2.0.0) 115 | plist (>= 3.1.0, < 4.0.0) 116 | public_suffix (~> 2.0.0) 117 | rubyzip (>= 1.3.0, < 2.0.0) 118 | security (= 0.1.3) 119 | simctl (~> 1.6.3) 120 | slack-notifier (>= 2.0.0, < 3.0.0) 121 | terminal-notifier (>= 2.0.0, < 3.0.0) 122 | terminal-table (>= 1.4.5, < 2.0.0) 123 | tty-screen (>= 0.6.3, < 1.0.0) 124 | tty-spinner (>= 0.8.0, < 1.0.0) 125 | word_wrap (~> 1.0.0) 126 | xcodeproj (>= 1.13.0, < 2.0.0) 127 | xcpretty (~> 0.3.0) 128 | xcpretty-travis-formatter (>= 0.0.3) 129 | fourflusher (2.3.1) 130 | fuzzy_match (2.0.4) 131 | gh_inspector (1.1.3) 132 | google-api-client (0.36.4) 133 | addressable (~> 2.5, >= 2.5.1) 134 | googleauth (~> 0.9) 135 | httpclient (>= 2.8.1, < 3.0) 136 | mini_mime (~> 1.0) 137 | representable (~> 3.0) 138 | retriable (>= 2.0, < 4.0) 139 | signet (~> 0.12) 140 | google-cloud-core (1.5.0) 141 | google-cloud-env (~> 1.0) 142 | google-cloud-errors (~> 1.0) 143 | google-cloud-env (1.3.1) 144 | faraday (>= 0.17.3, < 2.0) 145 | google-cloud-errors (1.0.0) 146 | google-cloud-storage (1.25.1) 147 | addressable (~> 2.5) 148 | digest-crc (~> 0.4) 149 | google-api-client (~> 0.33) 150 | google-cloud-core (~> 1.2) 151 | googleauth (~> 0.9) 152 | mini_mime (~> 1.0) 153 | googleauth (0.11.0) 154 | faraday (>= 0.17.3, < 2.0) 155 | jwt (>= 1.4, < 3.0) 156 | memoist (~> 0.16) 157 | multi_json (~> 1.11) 158 | os (>= 0.9, < 2.0) 159 | signet (~> 0.12) 160 | highline (1.7.10) 161 | http-cookie (1.0.3) 162 | domain_name (~> 0.5) 163 | httpclient (2.8.3) 164 | i18n (0.9.5) 165 | concurrent-ruby (~> 1.0) 166 | jmespath (1.4.0) 167 | json (2.3.0) 168 | jwt (2.1.0) 169 | memoist (0.16.2) 170 | mini_magick (4.10.1) 171 | mini_mime (1.0.2) 172 | minitest (5.13.0) 173 | molinillo (0.6.6) 174 | multi_json (1.14.1) 175 | multi_xml (0.6.0) 176 | multipart-post (2.0.0) 177 | nanaimo (0.2.6) 178 | nap (1.1.0) 179 | naturally (2.2.0) 180 | netrc (0.11.0) 181 | os (1.1.0) 182 | plist (3.5.0) 183 | public_suffix (2.0.5) 184 | representable (3.0.4) 185 | declarative (< 0.1.0) 186 | declarative-option (< 0.2.0) 187 | uber (< 0.2.0) 188 | retriable (3.1.2) 189 | rouge (2.0.7) 190 | ruby-macho (1.4.0) 191 | rubyzip (1.3.0) 192 | security (0.1.3) 193 | signet (0.14.0) 194 | addressable (~> 2.3) 195 | faraday (>= 0.17.3, < 2.0) 196 | jwt (>= 1.5, < 3.0) 197 | multi_json (~> 1.10) 198 | simctl (1.6.8) 199 | CFPropertyList 200 | naturally 201 | slack-notifier (2.3.2) 202 | terminal-notifier (2.0.0) 203 | terminal-table (1.8.0) 204 | unicode-display_width (~> 1.1, >= 1.1.1) 205 | thread_safe (0.3.6) 206 | tty-cursor (0.7.1) 207 | tty-screen (0.7.1) 208 | tty-spinner (0.9.3) 209 | tty-cursor (~> 0.7) 210 | tzinfo (1.2.6) 211 | thread_safe (~> 0.1) 212 | uber (0.1.0) 213 | unf (0.1.4) 214 | unf_ext 215 | unf_ext (0.0.7.7) 216 | unicode-display_width (1.7.0) 217 | word_wrap (1.0.0) 218 | xcodeproj (1.15.0) 219 | CFPropertyList (>= 2.3.3, < 4.0) 220 | atomos (~> 0.1.3) 221 | claide (>= 1.0.2, < 2.0) 222 | colored2 (~> 3.1) 223 | nanaimo (~> 0.2.6) 224 | xcpretty (0.3.0) 225 | rouge (~> 2.0.7) 226 | xcpretty-travis-formatter (1.0.0) 227 | xcpretty (~> 0.2, >= 0.0.7) 228 | 229 | PLATFORMS 230 | ruby 231 | 232 | DEPENDENCIES 233 | cocoapods 234 | fastlane 235 | 236 | BUNDLED WITH 237 | 2.1.2 238 | -------------------------------------------------------------------------------- /Mediator/Classes/Map/RZMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/19. 6 | // 7 | 8 | #import 9 | #import "RZMapNode.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface RZMap : NSObject 14 | @property(nonatomic, strong) NSArray *nodes; 15 | 16 | - (RZMapNode *)findMapNodeByValue:(NSString *)valueStr; 17 | - (BOOL)detectCircle; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Mediator/Classes/Map/RZMap.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/19. 6 | // 7 | 8 | #import "RZMap.h" 9 | 10 | @implementation RZMap 11 | 12 | - (RZMapNode *)findMapNodeByValue:(NSString *)valueStr{ 13 | return [self p_findMapNodeByValue:valueStr inArray:self.nodes]; 14 | } 15 | 16 | - (BOOL)detectCircle{ 17 | BOOL containsCircle = NO; 18 | NSMutableArray *nodeArr = [NSMutableArray arrayWithArray:self.nodes]; 19 | do { 20 | BOOL canFindNoPredecessorNode = [self p_findNoPredecessorsNodeAndDeleteInArray:nodeArr]; 21 | 22 | if (nodeArr.count == 0) { 23 | break; 24 | } 25 | 26 | if (!canFindNoPredecessorNode && nodeArr.count > 0) { 27 | containsCircle = YES; 28 | break; 29 | } 30 | 31 | } while (true); 32 | 33 | return containsCircle; 34 | } 35 | 36 | - (BOOL)p_findNoPredecessorsNodeAndDeleteInArray:(NSMutableArray *)nodeArr { 37 | NSInteger index = [nodeArr indexOfObjectPassingTest:^BOOL(RZMapNode * _Nonnull node, NSUInteger idx, BOOL * _Nonnull stop) { 38 | return node.predecessors.count == 0; 39 | }]; 40 | 41 | if (index == NSNotFound) { 42 | return NO; 43 | } 44 | 45 | RZMapNode *node = [nodeArr objectAtIndex:index]; 46 | if (node.successors.count > 0) { 47 | for (NSString *successor in node.successors) { 48 | RZMapNode *successorNode = [self p_findMapNodeByValue:successor inArray:nodeArr]; 49 | if (successorNode && [successorNode.predecessors containsObject:node.valueStr]) { 50 | [successorNode.predecessors removeObject:node.valueStr]; 51 | } 52 | } 53 | } 54 | [nodeArr removeObject:node]; 55 | return YES; 56 | } 57 | 58 | - (RZMapNode *)p_findMapNodeByValue:(NSString *)valueStr inArray:(NSArray *)nodeArr { 59 | NSInteger index = [nodeArr indexOfObjectPassingTest:^BOOL(RZMapNode * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 60 | return [valueStr isEqualToString:obj.valueStr]; 61 | }]; 62 | 63 | return index == NSNotFound ? nil : [nodeArr objectAtIndex:index]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Mediator/Classes/Map/RZMapNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/18. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface RZMapNode : NSObject 13 | @property(nonatomic, strong) NSMutableArray *predecessors; 14 | @property(nonatomic, strong) NSMutableArray *successors; 15 | @property(nonatomic, strong) NSString *valueStr; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Mediator/Classes/Map/RZMapNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZMap.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/8/18. 6 | // 7 | 8 | #import "RZMapNode.h" 9 | 10 | @implementation RZMapNode 11 | 12 | - (instancetype)init 13 | { 14 | self = [super init]; 15 | if (self) { 16 | _predecessors = [NSMutableArray array]; 17 | _successors = [NSMutableArray array]; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Mediator/Classes/RZAppLaunchBaseTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchBaseTask.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/5/15. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface RZAppLaunchBaseTask : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Mediator/Classes/RZAppLaunchBaseTask.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZAppLaunchBaseTask.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/5/15. 6 | // 7 | 8 | #import "RZAppLaunchBaseTask.h" 9 | 10 | @interface RZAppLaunchBaseTask () 11 | @property(nonatomic, assign) CFAbsoluteTime operateTime; 12 | @end 13 | 14 | @implementation RZAppLaunchBaseTask 15 | 16 | - (BOOL)runForLaunchLife:(NSInteger)life { 17 | return YES; 18 | } 19 | 20 | - (RZLaunchPriority)priorityForLaunchLife:(NSInteger)life{ 21 | return RZLaunchPriority_Auto; 22 | } 23 | 24 | - (void)operateBeforeRunLaunchLife:(NSInteger)life{ 25 | self.operateTime = CFAbsoluteTimeGetCurrent(); 26 | } 27 | 28 | - (void)operateAfterRunLaunchLife:(NSInteger)life{ 29 | self.operateTime = CFAbsoluteTimeGetCurrent() - self.operateTime; 30 | } 31 | 32 | - (CFAbsoluteTime)getOperateTime{ 33 | return _operateTime; 34 | } 35 | 36 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life{ 37 | return NO; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Mediator/Classes/RZLaunchContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZLaunchContext.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface RZLaunchContext : NSObject 14 | 15 | @property (nonatomic, strong) UIApplication* application; 16 | @property (nonatomic, strong) NSDictionary* launchOptions; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Mediator/Classes/RZLaunchContext.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZLaunchContext.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import "RZLaunchContext.h" 9 | 10 | @implementation RZLaunchContext 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Mediator/Classes/RZLaunchProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZLaunchProtocol.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import 9 | 10 | typedef NS_ENUM(NSInteger, RZLaunchLife) { 11 | RZLaunchLife_Load = 0, 12 | RZLaunchLife_Constructor, 13 | RZLaunchLife_WillFinishLaunching, 14 | RZLaunchLife_DidFinishLaunchingBeforeHomeRender, 15 | RZLaunchLife_DidFinishLaunchingAfterHomeRender, 16 | RZLaunchLife_TaskAfterLaunching, 17 | RZLaunchLife_AppInitialization, 18 | RZLaunchLife_DidBecomeActive, 19 | RZLaunchLife_WillEnterForeground, 20 | RZLaunchLife_DidEnterBackground, 21 | RZLaunchLife_WillResignActive, 22 | RZLaunchLife_HomePageDidAppear, 23 | RZLaunchLife_HomePageDidActive, 24 | RZLaunchLife_Min = RZLaunchLife_Load, 25 | RZLaunchLife_Max = RZLaunchLife_HomePageDidActive, 26 | }; 27 | 28 | typedef NS_ENUM(NSInteger, RZLaunchThread) { 29 | RZLaunchThread_Main, 30 | RZLaunchThread_Work, 31 | RZLaunchThread_RunLoopWaiting //runloop 空闲 32 | }; 33 | 34 | typedef NS_ENUM(NSInteger, RZLaunchPriority) { 35 | RZLaunchPriority_Auto = 0, 36 | RZLaunchPriority_Low = -1, 37 | RZLaunchPriority_High = 1, 38 | }; 39 | 40 | NS_ASSUME_NONNULL_BEGIN 41 | 42 | @protocol RZLaunchProtocol 43 | 44 | /* 45 | * 任务执行之前的操作 46 | * @param life 生命周期 47 | */ 48 | - (void)operateBeforeRunLaunchLife:(NSInteger)life; 49 | /* 50 | * 指定每个生命周期需要执行的操作 51 | * @param life 生命周期 52 | */ 53 | - (BOOL)runForLaunchLife:(NSInteger)life; 54 | /* 55 | * 任务执行之后的操作 56 | * @param life 生命周期 57 | */ 58 | - (void)operateAfterRunLaunchLife:(NSInteger)life; 59 | 60 | /* 61 | * 获取任务执行的时间 62 | * @param life 生命周期 63 | */ 64 | - (CFAbsoluteTime)getOperateTime; 65 | /* 66 | * 是否立即执行,若为否,会先加入队列,然后执行 67 | * @param life 生命周期 68 | */ 69 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life; 70 | 71 | @optional 72 | 73 | /* 74 | * 指定启动任务的前驱,前驱完成后再执行该任务 75 | * @param life 生命周期 76 | */ 77 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life; 78 | 79 | /* 80 | * 指定启动任务的执行优先级 81 | * @param life 生命周期 82 | */ 83 | - (RZLaunchPriority)priorityForLaunchLife:(NSInteger)life; 84 | 85 | /* 86 | * 指定实例对象 87 | */ 88 | + (instancetype)launcher; 89 | 90 | /* 91 | * 指定启动任务的执行线程 92 | * @param life 生命周期 93 | */ 94 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life; 95 | 96 | @end 97 | 98 | NS_ASSUME_NONNULL_END 99 | -------------------------------------------------------------------------------- /Mediator/Classes/RZLauncher.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZLauncher.h 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import 9 | #import "RZLaunchProtocol.h" 10 | #import "RZLaunchContext.h" 11 | 12 | #define RZL_ADD_SECTION_DATA(sectname) __attribute((used, section("__DATA," #sectname " "))) 13 | 14 | #define RZLAUNCH_REGISTER(task) \ 15 | char* k##task##_register RZL_ADD_SECTION_DATA(RZLauncher) = "" #task ""; 16 | 17 | #define RZLocalLaunchConfigName @"RZLaunchTask" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | extern NSArray* RZLaunchLoadConfiguration(const char* sectionName); 22 | 23 | @interface RZLauncher : NSObject 24 | 25 | @property (nonatomic, strong) RZLaunchContext* context; 26 | 27 | + (instancetype)sharedLauncher; 28 | - (void)onTrigger:(NSInteger)type; 29 | - (NSDictionary *)getLaunchTaskReport; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | 35 | -------------------------------------------------------------------------------- /Mediator/Classes/RZLauncher.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZLauncher.m 3 | // Mediator 4 | // 5 | // Created by tingdongli on 2020/3/19. 6 | // 7 | 8 | #import "RZLauncher.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #import 15 | #import 16 | #import "RZMap.h" 17 | 18 | const char* kRZLauncherSectionName = "RZLauncher"; 19 | const NSInteger RZMaxConcurrentOperationCount = 6; 20 | 21 | NSArray* RZLaunchLoadConfiguration(const char* sectionName) 22 | { 23 | NSMutableArray* configs = [NSMutableArray array]; 24 | 25 | Dl_info info; 26 | dladdr(RZLaunchLoadConfiguration, &info); 27 | 28 | #ifndef __LP64__ 29 | const struct mach_header* mhp = (struct mach_header*)info.dli_fbase; 30 | unsigned long size = 0; 31 | uint32_t* memory = (uint32_t*)getsectiondata(mhp, SEG_DATA, sectionName, &size); 32 | #else /* defined(__LP64__) */ 33 | const struct mach_header_64* mhp = (struct mach_header_64*)info.dli_fbase; 34 | unsigned long size = 0; 35 | uint64_t* memory = (uint64_t*)getsectiondata(mhp, SEG_DATA, sectionName, &size); 36 | #endif /* defined(__LP64__) */ 37 | 38 | unsigned long counter = size / sizeof(void*); 39 | for (int idx = 0; idx < counter; ++idx) { 40 | char* string = (char*)memory[idx]; 41 | @autoreleasepool { 42 | NSString *configName = [NSString stringWithUTF8String:string]; 43 | if (configName) { 44 | [configs addObject:configName]; 45 | } 46 | } 47 | } 48 | 49 | return configs; 50 | } 51 | 52 | __attribute__((constructor)) static void constructRZLauncher(void) 53 | { 54 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_Constructor]; 55 | } 56 | 57 | @interface RZLauncher () { 58 | NSMutableArray>* _launchTasks; 59 | NSMutableDictionary *_launchTaskReportDict; 60 | NSLock *_lock; 61 | NSLock *_blockOperationLock; 62 | NSOperationQueue *_commonConcurrentQueue; 63 | NSMutableDictionary *_launchTaskOperationDict; 64 | NSDictionary *_localPlistLaunchTasksDict; 65 | } 66 | 67 | @end 68 | 69 | @implementation RZLauncher 70 | 71 | + (void)load 72 | { 73 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_Load]; 74 | } 75 | 76 | + (instancetype)sharedLauncher 77 | { 78 | static dispatch_once_t onceToken; 79 | static RZLauncher* launcher; 80 | dispatch_once(&onceToken, ^{ 81 | launcher = [[self alloc] init]; 82 | NSArray* registerTaskNames = RZLaunchLoadConfiguration(kRZLauncherSectionName); 83 | NSArray* LocalPlistLaunchTaskNames = [launcher loadLocalLaunchTasks]; 84 | NSMutableArray *taskNames = [NSMutableArray array]; 85 | [taskNames addObjectsFromArray:registerTaskNames]; 86 | [taskNames addObjectsFromArray:LocalPlistLaunchTaskNames]; 87 | 88 | for (NSString* name in taskNames) { 89 | [launcher registerLaunchTaskName:name]; 90 | } 91 | }); 92 | return launcher; 93 | } 94 | 95 | - (instancetype)init 96 | { 97 | self = [super init]; 98 | if (self) { 99 | _launchTasks = [NSMutableArray array]; 100 | _launchTaskReportDict = [NSMutableDictionary dictionary]; 101 | _lock = [[NSLock alloc] init]; 102 | _commonConcurrentQueue = [[NSOperationQueue alloc] init]; 103 | _commonConcurrentQueue.maxConcurrentOperationCount = RZMaxConcurrentOperationCount; 104 | _launchTaskOperationDict = [NSMutableDictionary dictionary]; 105 | _blockOperationLock = [[NSLock alloc] init]; 106 | } 107 | 108 | return self; 109 | } 110 | 111 | - (NSArray *)loadLocalLaunchTasks 112 | { 113 | 114 | NSString *plistPath = [[NSBundle mainBundle] pathForResource:RZLocalLaunchConfigName ofType:@"plist"]; 115 | if (![[NSFileManager defaultManager] fileExistsAtPath:plistPath]) { 116 | return @[]; 117 | } 118 | 119 | _localPlistLaunchTasksDict = [[NSDictionary alloc] initWithContentsOfFile:plistPath]; 120 | 121 | NSArray *launchTasks = _localPlistLaunchTasksDict.allKeys; 122 | 123 | if (launchTasks && launchTasks.count > 0) { 124 | return launchTasks; 125 | } 126 | 127 | return @[]; 128 | } 129 | 130 | - (void)registerLaunchTaskName:(NSString*)name 131 | { 132 | Class taskClass = NSClassFromString(name); 133 | NSAssert([taskClass conformsToProtocol:@protocol(RZLaunchProtocol)], @"%@ does not conform to RZLaunchProtocol", name); 134 | 135 | if ([taskClass conformsToProtocol:@protocol(RZLaunchProtocol)]) { 136 | id task = nil; 137 | if ([taskClass respondsToSelector:@selector(launcher)]) { 138 | task = [taskClass launcher]; 139 | } else { 140 | task = [[taskClass alloc] init]; 141 | } 142 | if (task) { 143 | [_launchTasks addObject:task]; 144 | } 145 | } 146 | } 147 | 148 | - (void)registerBlockOperationsWithLaunchLife:(NSInteger)launchLiftIndex{ 149 | 150 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull task, NSUInteger idx, BOOL * _Nonnull stop) { 151 | if (![task runImmediatelyForLaunchLife:launchLiftIndex]) { 152 | [self registerBlockWithTask:task withLaunchLife:launchLiftIndex]; 153 | } 154 | }]; 155 | } 156 | 157 | 158 | - (void)registerBlockWithTask:(id)task withLaunchLife:(NSInteger)launchLiftIndex{ 159 | NSMutableDictionary *runLiftOperationDict = [NSMutableDictionary dictionary]; 160 | NSString *taskKey = NSStringFromClass(task.class); 161 | if ([_launchTaskOperationDict.allKeys containsObject:taskKey]) { 162 | [runLiftOperationDict addEntriesFromDictionary:[_launchTaskOperationDict objectForKey:taskKey]]; 163 | } 164 | __weak typeof(self) weakSelf = self; 165 | NSBlockOperation *liftOperation = [NSBlockOperation blockOperationWithBlock:^{ 166 | if (weakSelf) { 167 | [weakSelf p_checkOperateBeforeAndRunWithTask:task launchLife:launchLiftIndex]; 168 | } 169 | [task runForLaunchLife:launchLiftIndex]; 170 | if (weakSelf) { 171 | [weakSelf p_checkOperateAfterAndRunWithTask:task launchLife:launchLiftIndex]; 172 | } 173 | }]; 174 | if (liftOperation) { 175 | [runLiftOperationDict setObject:liftOperation forKey:@(launchLiftIndex)]; 176 | } 177 | 178 | [_blockOperationLock lock]; 179 | [_launchTaskOperationDict setValue:runLiftOperationDict.copy forKey:taskKey]; 180 | [_blockOperationLock unlock]; 181 | } 182 | 183 | - (void)onTrigger:(NSInteger)type 184 | { 185 | RZMap *map = [self p_creatMapWithLaunchLife:type]; 186 | NSAssert(![map detectCircle], @"启动任务存在循环依赖!"); 187 | if ([map detectCircle]) { 188 | return ; 189 | } 190 | 191 | //生成type对应的BlockOperation 192 | [self registerBlockOperationsWithLaunchLife:type]; 193 | //增加依赖 194 | [self addDependencysWithLaunchLife:type]; 195 | 196 | // 启动流程应该是串型的,所以这里不加锁处理 197 | NSMutableArray>* lowPriorityLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 198 | NSMutableArray>* normalPriorityLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 199 | NSMutableArray>* runloopWaitingLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 200 | NSMutableArray>* deleteLaunchers = [NSMutableArray arrayWithCapacity:_launchTasks.count]; 201 | [_launchTasks enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 202 | RZLaunchPriority priority = RZLaunchPriority_Auto; 203 | if ([launcher respondsToSelector:@selector(priorityForLaunchLife:)]) { 204 | priority = [launcher priorityForLaunchLife:type]; 205 | } 206 | 207 | switch (priority) { 208 | case RZLaunchPriority_High: 209 | if ([self launchTaskNeedRunWhenRunLoopWaiting:launcher launchLife:type]) { 210 | [runloopWaitingLaunchers addObject:launcher]; 211 | }else{ 212 | [self runForLaunchLife:type forTask:launcher deleteArr:deleteLaunchers]; 213 | } 214 | break; 215 | case RZLaunchPriority_Auto: 216 | [normalPriorityLaunchers addObject:launcher]; 217 | break; 218 | case RZLaunchPriority_Low: 219 | [lowPriorityLaunchers addObject:launcher]; 220 | break; 221 | default: 222 | break; 223 | } 224 | }]; 225 | if (normalPriorityLaunchers.count > 0) { 226 | [normalPriorityLaunchers enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 227 | if ([self launchTaskNeedRunWhenRunLoopWaiting:launcher launchLife:type]) { 228 | [runloopWaitingLaunchers addObject:launcher]; 229 | }else{ 230 | [self runForLaunchLife:type forTask:launcher deleteArr:deleteLaunchers]; 231 | } 232 | }]; 233 | } 234 | if (lowPriorityLaunchers.count > 0) { 235 | [lowPriorityLaunchers enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 236 | if ([self launchTaskNeedRunWhenRunLoopWaiting:launcher launchLife:type]) { 237 | [runloopWaitingLaunchers addObject:launcher]; 238 | }else{ 239 | [self runForLaunchLife:type forTask:launcher deleteArr:deleteLaunchers]; 240 | } 241 | }]; 242 | } 243 | 244 | //runloop空闲执行 245 | if (runloopWaitingLaunchers && runloopWaitingLaunchers.count > 0) { 246 | CFRunLoopRef runLoop = CFRunLoopGetCurrent(); 247 | CFStringRef runLoopMode = kCFRunLoopDefaultMode; 248 | CFRunLoopObserverRef observer = CFRunLoopObserverCreateWithHandler(kCFAllocatorDefault, kCFRunLoopBeforeWaiting, true, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity _) { 249 | [runloopWaitingLaunchers enumerateObjectsUsingBlock:^(id launcher, NSUInteger idx, BOOL* stop) { 250 | 251 | if ([launcher runImmediatelyForLaunchLife:type]) { 252 | [self p_checkOperateBeforeAndRunWithTask:launcher launchLife:type]; 253 | [launcher runForLaunchLife:type]; 254 | [self p_checkOperateAfterAndRunWithTask:launcher launchLife:type]; 255 | }else{ 256 | NSDictionary *runThisTaskLifeOperationDict = [self->_launchTaskOperationDict objectForKey:NSStringFromClass(launcher.class)]; 257 | NSBlockOperation *runThisTaskLifeOperation = [runThisTaskLifeOperationDict objectForKey:@(type)]; 258 | 259 | if (runThisTaskLifeOperation) { 260 | [[NSOperationQueue mainQueue] addOperation:runThisTaskLifeOperation]; 261 | } 262 | } 263 | 264 | }]; 265 | CFRunLoopRemoveObserver(runLoop, observer, runLoopMode); 266 | CFRelease(observer); 267 | }); 268 | CFRunLoopAddObserver(runLoop, observer, runLoopMode); 269 | } 270 | 271 | 272 | 273 | if (deleteLaunchers.count > 0) { 274 | [_launchTasks removeObjectsInArray:deleteLaunchers]; 275 | } 276 | } 277 | 278 | - (void)runForLaunchLife:(NSInteger)type forTask:(id)task deleteArr:(NSMutableArray>*)deleteArr{ 279 | RZLaunchThread launchThread = RZLaunchThread_Main; 280 | if ([task respondsToSelector:@selector(runInThreadForLaunchLife:)]) { 281 | launchThread = [task runInThreadForLaunchLife:type]; 282 | } 283 | 284 | NSDictionary *runThisTaskLifeOperationDict = [_launchTaskOperationDict objectForKey:NSStringFromClass(task.class)]; 285 | NSBlockOperation *runThisTaskLifeOperation = [runThisTaskLifeOperationDict objectForKey:@(type)]; 286 | 287 | if (launchThread == RZLaunchThread_Work) { 288 | if (runThisTaskLifeOperation) { 289 | [_commonConcurrentQueue addOperation:runThisTaskLifeOperation]; 290 | } 291 | }else{ 292 | //主线程 293 | if ([task runImmediatelyForLaunchLife:type]) { 294 | //需要立即执行 295 | [self p_checkOperateBeforeAndRunWithTask:task launchLife:type]; 296 | [task runForLaunchLife:type]; 297 | [self p_checkOperateAfterAndRunWithTask:task launchLife:type]; 298 | }else{ 299 | if (runThisTaskLifeOperation) { 300 | [[NSOperationQueue mainQueue] addOperation:runThisTaskLifeOperation]; 301 | } 302 | } 303 | } 304 | } 305 | 306 | - (void)addDependencysWithLaunchLife:(NSInteger)launchLifeIndex{ 307 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 308 | if ([self p_getPredecessorsForTask:obj forLaunchLife:launchLifeIndex]) { 309 | NSArray *runPredecessors = [self p_getPredecessorsForTask:obj forLaunchLife:launchLifeIndex]; 310 | if (runPredecessors && runPredecessors.count > 0) { 311 | NSDictionary *runThisTaskLifeOperationDict = [_launchTaskOperationDict objectForKey:NSStringFromClass(obj.class)]; 312 | NSBlockOperation *runThisTaskLifeOperation = [runThisTaskLifeOperationDict objectForKey:@(launchLifeIndex)]; 313 | for (NSString *runPredecessorName in runPredecessors) { 314 | NSDictionary *runPredecessorTaskLifeOperationDict = [_launchTaskOperationDict objectForKey:runPredecessorName]; 315 | NSBlockOperation *runPredecessorTaskLifeOperation = [runPredecessorTaskLifeOperationDict objectForKey:@(launchLifeIndex)]; 316 | if (runPredecessorTaskLifeOperation) { 317 | [runThisTaskLifeOperation addDependency:runPredecessorTaskLifeOperation]; 318 | } 319 | } 320 | } 321 | } 322 | }]; 323 | } 324 | 325 | - (BOOL)launchTaskNeedRunWhenRunLoopWaiting:(id)task launchLife:(NSInteger)type{ 326 | return [task respondsToSelector:@selector(runInThreadForLaunchLife:)] && [task runInThreadForLaunchLife:type] == RZLaunchThread_RunLoopWaiting; 327 | } 328 | 329 | 330 | - (NSDictionary *)getLaunchTaskReport{ 331 | return _launchTaskReportDict.copy; 332 | } 333 | 334 | 335 | #pragma mark private method 336 | - (void)p_checkOperateBeforeAndRunWithTask:(id)task launchLife:(NSInteger)type{ 337 | if ([task respondsToSelector:@selector(operateBeforeRunLaunchLife:)]) { 338 | [task operateBeforeRunLaunchLife:type]; 339 | } 340 | } 341 | 342 | - (void)p_checkOperateAfterAndRunWithTask:(id)task launchLife:(NSInteger)type{ 343 | if ([task respondsToSelector:@selector(operateAfterRunLaunchLife:)]) { 344 | [task operateAfterRunLaunchLife:type]; 345 | [self p_addToReportDictByTask:task launchLife:type]; 346 | } 347 | } 348 | 349 | - (void)p_addToReportDictByTask:(id)task launchLife:(NSInteger)type{ 350 | if (type == RZLaunchLife_DidFinishLaunchingBeforeHomeRender || type == RZLaunchLife_DidFinishLaunchingAfterHomeRender) { 351 | if ([task respondsToSelector:@selector(getOperateTime)]) { 352 | NSString *operateTimeStr = [NSString stringWithFormat:@"%lf", [task getOperateTime]]; 353 | [_lock lock]; 354 | [_launchTaskReportDict setValue:operateTimeStr forKey:NSStringFromClass(task.class)]; 355 | [_lock unlock]; 356 | } 357 | } 358 | } 359 | 360 | - (NSArray *)p_getPredecessorsForTask:(id)task forLaunchLife:(NSInteger)life{ 361 | if ([task respondsToSelector:@selector(runPredecessorsForLaunchLife:)]) { 362 | NSArray *predecessors = [task runPredecessorsForLaunchLife:life]; 363 | if (predecessors && predecessors.count > 0) { 364 | return predecessors; 365 | } 366 | } 367 | 368 | NSDictionary *lifePredecessorsDict = [_localPlistLaunchTasksDict objectForKey:NSStringFromClass(task.class)]; 369 | NSString *liftStrKey = [NSString stringWithFormat:@"%@", @(life)]; 370 | id lifePredecessors = [lifePredecessorsDict objectForKey: liftStrKey]; 371 | if ([lifePredecessors isKindOfClass:[NSArray class]]) { 372 | NSArray *tLifePredecessors = lifePredecessors; 373 | if (tLifePredecessors && tLifePredecessors.count > 0) { 374 | return tLifePredecessors; 375 | } 376 | } 377 | 378 | return nil; 379 | } 380 | 381 | #pragma mark Map 382 | 383 | - (RZMap *)p_creatMapWithLaunchLife:(NSInteger)type{ 384 | RZMap *map = [[RZMap alloc] init]; 385 | NSMutableArray *mapNodeArr = [NSMutableArray array]; 386 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 387 | RZMapNode *node = [[RZMapNode alloc] init]; 388 | node.valueStr = NSStringFromClass(obj.class); 389 | 390 | if ([self p_getPredecessorsForTask:obj forLaunchLife:type]) { 391 | NSArray *predecessors = [self p_getPredecessorsForTask:obj forLaunchLife:type]; 392 | if (predecessors && predecessors.count > 0) { 393 | [node.predecessors addObjectsFromArray:predecessors]; 394 | } 395 | } 396 | [mapNodeArr addObject:node]; 397 | }]; 398 | map.nodes = mapNodeArr.copy; 399 | 400 | [_launchTasks enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 401 | if ([self p_getPredecessorsForTask:obj forLaunchLife:type]) { 402 | NSArray *predecessors = [self p_getPredecessorsForTask:obj forLaunchLife:type]; 403 | if (predecessors && predecessors.count > 0) { 404 | for (NSString *predecessor in predecessors) { 405 | RZMapNode *node = [map findMapNodeByValue:predecessor]; 406 | if (node) { 407 | [node.successors addObject:NSStringFromClass(obj.class)]; 408 | } 409 | } 410 | } 411 | } 412 | }]; 413 | return map; 414 | } 415 | 416 | @end 417 | 418 | -------------------------------------------------------------------------------- /Mediator/Classes/RZModuleBaseProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleBaseProtocol.h 3 | // 4 | // Created by tingdongli on 2019/7/24. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #ifndef RZModuleBaseProtocol_h 9 | #define RZModuleBaseProtocol_h 10 | 11 | @protocol RZModuleBaseProtocol 12 | 13 | @optional 14 | - (id)unitTest; 15 | 16 | @end 17 | 18 | #endif /* RZModuleBaseProtocol */ 19 | -------------------------------------------------------------------------------- /Mediator/Classes/RZModuleMediator.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleMediator.h 3 | // 4 | // Created by tingdongli on 2019/7/24. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "RZModuleBaseProtocol.h" 10 | #import "RZModuleRegister.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface RZModuleMediator : NSObject 15 | 16 | + (instancetype)sharedInstance; 17 | 18 | //注册类 19 | - (void)registerProtocol:(Protocol*)protocol forClass:(Class)cls; 20 | - (Class)classForProtocol:(Protocol*)protocol; 21 | 22 | //接口的实现类 23 | - (id)implForProtocol:(Protocol*)protocol; 24 | 25 | + (id)implObjForProtocol:(Protocol*)protocol; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /Mediator/Classes/RZModuleMediator.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleMediator.m 3 | // 4 | // Created by tingdongli on 2019/7/24. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import "RZModuleMediator.h" 9 | 10 | @interface RZModuleMediator () { 11 | NSLock* _lock; 12 | } 13 | 14 | @property (nonatomic, strong) NSMutableDictionary* protocolCache; 15 | @property (nonatomic, strong) NSMutableDictionary* impObjCache; 16 | 17 | @end 18 | 19 | @implementation RZModuleMediator 20 | 21 | + (instancetype)sharedInstance 22 | { 23 | static RZModuleMediator* mediator = nil; 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | mediator = [[RZModuleMediator alloc] init]; 27 | }); 28 | return mediator; 29 | } 30 | 31 | - (instancetype)init 32 | { 33 | self = [super init]; 34 | if (self) { 35 | self.protocolCache = [NSMutableDictionary dictionary]; 36 | self.impObjCache = [NSMutableDictionary dictionary]; 37 | _lock = [[NSLock alloc] init]; 38 | } 39 | 40 | return self; 41 | } 42 | 43 | /* 44 | * 注册接口,把实现的Class注册到对应的Protocol上 45 | * 调用方根据Protocol查找到对应的Class,然后调用Class的方法 (这里一般是创建Class对象,然后调用这个对象实现的Protocol方法,进而根据接口编程) 46 | * 47 | */ 48 | 49 | - (void)registerProtocol:(Protocol*)protocol forClass:(Class)cls 50 | { 51 | NSAssert(![self classForProtocol:protocol], ([NSString stringWithFormat:@"❌ %@不应该注册两次,请检查...", NSStringFromProtocol(protocol)])); 52 | [self.protocolCache setObject:cls forKey:NSStringFromProtocol(protocol)]; 53 | } 54 | 55 | - (Class)classForProtocol:(Protocol*)protocol 56 | { 57 | return self.protocolCache[NSStringFromProtocol(protocol)]; 58 | } 59 | 60 | - (id)implForProtocol:(Protocol*)protocol 61 | { 62 | NSString* key = NSStringFromProtocol(protocol); 63 | 64 | [_lock lock]; 65 | Class cls = self.protocolCache[key]; 66 | 67 | NSAssert(cls, ([NSString stringWithFormat:@"❌请检查调用的模块(%@)是否注册了实现类!", key])); 68 | 69 | id imp = self.impObjCache[key]; 70 | if (!imp) { 71 | imp = [[cls alloc] init]; 72 | [self.impObjCache setObject:imp forKey:key]; 73 | } 74 | [_lock unlock]; 75 | 76 | NSAssert(imp && [imp conformsToProtocol:protocol], @"❌ImpL 必须要遵从Protocol"); 77 | NSAssert([imp conformsToProtocol:@protocol(RZModuleBaseProtocol)], @"❌ImpL 实现的Protocol必须从RZModuleBaseProtocol继承!"); 78 | 79 | return imp; 80 | } 81 | 82 | + (id)implObjForProtocol:(Protocol*)protocol 83 | { 84 | return [[RZModuleMediator sharedInstance] implForProtocol:protocol]; 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /Mediator/Classes/RZModuleRegister.h: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleRegister.h 3 | // 4 | // Created by tingdongli on 2019/8/1. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "RZAppLaunchBaseTask.h" 10 | 11 | #define RZM_ADD_SECTION_DATA(sectname) __attribute((used, section("__DATA," #sectname " "))) 12 | 13 | #define RZM_EXPORT_MODULE_PROTOCOL(protocolName, impl) \ 14 | char* k##protocolName##_service RZM_ADD_SECTION_DATA(RZModuleImpl) = "" #protocolName ":" #impl ""; 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface RZModuleRegister : RZAppLaunchBaseTask 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Mediator/Classes/RZModuleRegister.m: -------------------------------------------------------------------------------- 1 | // 2 | // RZModuleRegister.m 3 | // 4 | // Created by tingdongli on 2019/8/1. 5 | // Copyright © 2019 Tencent. All rights reserved. 6 | // 7 | 8 | #import "RZModuleRegister.h" 9 | #import "RZModuleMediator.h" 10 | #import "RZLauncher.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #import 17 | #import 18 | 19 | NSArray* RZReadConfiguration(char* sectionName, const struct mach_header* mhp); 20 | 21 | static void dyld_callback(const struct mach_header* mhp, intptr_t vmaddr_slide) 22 | { 23 | NSArray* protocol2Impls = RZReadConfiguration("RZModuleImpl", mhp); 24 | for (NSString* protocol2ImplConfig in protocol2Impls) { 25 | 26 | NSArray* array = [protocol2ImplConfig componentsSeparatedByString:@":"]; 27 | 28 | if (array.count == 2) { 29 | NSString* protocol = array[0]; 30 | NSString* clsName = array[1]; 31 | 32 | if (protocol && clsName) { 33 | [[RZModuleMediator sharedInstance] registerProtocol:NSProtocolFromString(protocol) forClass:NSClassFromString(clsName)]; 34 | } 35 | } 36 | } 37 | } 38 | 39 | NSArray* RZReadConfiguration(char* sectionName, const struct mach_header* mhp) 40 | { 41 | NSMutableArray* configs = [NSMutableArray array]; 42 | unsigned long size = 0; 43 | #ifndef __LP64__ 44 | uintptr_t* memory = (uintptr_t*)getsectiondata(mhp, SEG_DATA, sectionName, &size); 45 | #else 46 | const struct mach_header_64* mhp64 = (const struct mach_header_64*)mhp; 47 | uintptr_t* memory = (uintptr_t*)getsectiondata(mhp64, SEG_DATA, sectionName, &size); 48 | #endif 49 | 50 | unsigned long counter = size / sizeof(void*); 51 | for (int idx = 0; idx < counter; ++idx) { 52 | char* string = (char*)memory[idx]; 53 | NSString* str = [NSString stringWithUTF8String:string]; 54 | if (!str) 55 | continue; 56 | 57 | if (str) 58 | [configs addObject:str]; 59 | } 60 | 61 | return configs; 62 | } 63 | 64 | RZLAUNCH_REGISTER(RZModuleRegister) 65 | 66 | @interface RZModuleRegister () 67 | 68 | @end 69 | 70 | @implementation RZModuleRegister 71 | 72 | - (BOOL)runForLaunchLife:(NSInteger)life 73 | { 74 | if (life == RZLaunchLife_Constructor) { 75 | _dyld_register_func_for_add_image(dyld_callback); 76 | return NO; 77 | } 78 | 79 | return YES; 80 | } 81 | 82 | 83 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life{ 84 | if (life == RZLaunchLife_Constructor) { 85 | return YES; 86 | } 87 | return NO; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RZLauncher 2 | 3 | iOS启动框架,支持启动生命周期分发,启动任务分布式注册,启动任务依赖,支持设置启动任务在各生命周期的优先级,执行所在线程以及对其他启动任务的依赖。根据启动任务的依赖关系,检测循环依赖,并发执行,提升启动的效率。同时,统计各启动任务消耗的时间,暴露给外部使用。 4 | 5 | 6 | ## 接入 7 | 8 | ``` 9 | pod 'RZLauncher', '0.0.1' 10 | ``` 11 | 12 | 13 | ## 使用指南 14 | 15 | ### 1.生命周期分发 16 | 17 | ``` 18 | typedef NS_ENUM(NSInteger, RZLaunchLife) { 19 | RZLaunchLife_Load = 0, 20 | RZLaunchLife_Constructor, 21 | RZLaunchLife_WillFinishLaunching, 22 | RZLaunchLife_DidFinishLaunchingBeforeHomeRender, 23 | RZLaunchLife_DidFinishLaunchingAfterHomeRender, 24 | RZLaunchLife_TaskAfterLaunching, 25 | RZLaunchLife_AppInitialization, 26 | RZLaunchLife_DidBecomeActive, 27 | RZLaunchLife_WillEnterForeground, 28 | RZLaunchLife_DidEnterBackground, 29 | RZLaunchLife_WillResignActive, 30 | RZLaunchLife_HomePageDidAppear, 31 | RZLaunchLife_HomePageDidActive, 32 | RZLaunchLife_Min = RZLaunchLife_Load, 33 | RZLaunchLife_Max = RZLaunchLife_HomePageDidActive, 34 | }; 35 | 36 | ``` 37 | 38 | 在AppDelegate中的启动回调中触发分发,比如: 39 | 40 | ``` 41 | [[RZLauncher sharedLauncher] onTrigger:RZLaunchLife_DidBecomeActive]; 42 | ``` 43 | 44 | ### 2.启动任务注册 45 | 46 | 47 | (1) 继承RZAppLaunchBaseTask,添加宏 RZLAUNCH_REGISTER(RZAppLaunchTaskName)。 48 | 49 | `RZLAUNCH_REGISTER(RZAppLaunchTaskName) ` 50 | 51 | (2) 实现RZLaunchProtocol协议。 52 | 53 | 54 | ``` 55 | 56 | /* 57 | * 任务执行之前的操作 58 | * @param life 生命周期 59 | */ 60 | - (void)operateBeforeRunLaunchLife:(NSInteger)life; 61 | 62 | /* 63 | * 指定每个生命周期需要执行的操作 64 | * @param life 生命周期 65 | */ 66 | - (BOOL)runForLaunchLife:(NSInteger)life; 67 | 68 | /* 69 | * 任务执行之后的操作 70 | * @param life 生命周期 71 | */ 72 | - (void)operateAfterRunLaunchLife:(NSInteger)life; 73 | 74 | /* 75 | * 获取任务执行的时间 76 | * @param life 生命周期 77 | */ 78 | - (CFAbsoluteTime)getOperateTime; 79 | 80 | /* 81 | * 是否立即执行,若为否,会先加入队列,然后执行 82 | * @param life 生命周期 83 | */ 84 | - (BOOL)runImmediatelyForLaunchLife:(NSInteger)life; 85 | 86 | @optional 87 | 88 | /* 89 | * 指定启动任务的前驱,前驱完成后再执行该任务 90 | * @param life 生命周期 91 | */ 92 | - (NSArray *)runPredecessorsForLaunchLife:(NSInteger)life; 93 | 94 | /* 95 | * 指定启动任务的执行优先级 96 | * @param life 生命周期 97 | */ 98 | - (RZLaunchPriority)priorityForLaunchLife:(NSInteger)life; 99 | 100 | /* 101 | * 指定实例对象 102 | */ 103 | + (instancetype)launcher; 104 | 105 | /* 106 | * 指定启动任务的执行线程 107 | * @param life 生命周期 108 | */ 109 | - (RZLaunchThread)runInThreadForLaunchLife:(NSInteger)life; 110 | 111 | 112 | ``` 113 | 114 | 也可以通过plist注册,支持注册任务和配置任务前驱。 115 | 116 | ``` 117 | 118 | RZAppLaunchTask6 119 | 120 | //生命周期的枚举值 121 | 7 122 | 123 | RZAppLaunchTask2 124 | 125 | 126 | RZAppLaunchTask7 127 | 128 | 7 129 | 130 | RZAppLaunchTask2 131 | 132 | 133 | 134 | 135 | 136 | ``` 137 | 138 | 139 | # RZMediator 140 | 141 | iOS中间件,protocol-class映射模式,注册和使用起来简单,实现解耦的目的,搭配RZLauncher使用更佳。 142 | 143 | ## 使用指南 144 | 145 | ### 1.新建protocol,继承RZModuleBaseProtocol,并新建类来实现该protocol。 146 | 147 | ``` 148 | 149 | @protocol TestProtocol 150 | 151 | - (void)test; 152 | 153 | @end 154 | 155 | @interface TestImpl : NSObject 156 | 157 | @end 158 | 159 | ``` 160 | 161 | 162 | ### 2.注册protocol及实现该protocol的类名 163 | 164 | ``` 165 | 166 | RZM_EXPORT_MODULE_PROTOCOL(TestProtocol, TestImpl) 167 | 168 | ``` 169 | 170 | ### 3.使用。 171 | 172 | ``` 173 | [[RZModuleMediator implObjForProtocol: @protocol(TestProtocol)] test]; 174 | ``` 175 | 176 | 177 | 示例: 178 | 179 | ``` 180 | 181 | #import "RZModuleMediator.h" 182 | 183 | @protocol TestProtocol 184 | 185 | - (void)test; 186 | 187 | @end 188 | 189 | @interface TestImpl : NSObject 190 | 191 | @end 192 | 193 | 194 | RZM_EXPORT_MODULE_PROTOCOL(TestProtocol, TestImpl) 195 | 196 | 197 | ``` 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | --------------------------------------------------------------------------------