├── MultiProtocolManager ├── MultiProtocolManager.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── cython.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── cython.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── MultiProtocolManager │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── CYProtocolManager │ │ ├── CYProtocolManager.h │ │ └── CYProtocolManager.m │ ├── Controller │ │ ├── SViewController.h │ │ ├── SViewController.m │ │ ├── ThirdViewController.h │ │ ├── ThirdViewController.m │ │ ├── ViewController.h │ │ └── ViewController.m │ ├── Info.plist │ ├── View │ │ ├── ButtonView.h │ │ ├── ButtonView.m │ │ ├── TestView.h │ │ └── TestView.m │ └── main.m ├── MultiProtocolManagerTests │ ├── Info.plist │ └── MultiProtocolManagerTests.m └── MultiProtocolManagerUITests │ ├── Info.plist │ └── MultiProtocolManagerUITests.m └── README.md /MultiProtocolManager/MultiProtocolManager.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 34857FAE2283D65100B5F0ED /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FAD2283D65100B5F0ED /* AppDelegate.m */; }; 11 | 34857FB42283D65100B5F0ED /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34857FB22283D65100B5F0ED /* Main.storyboard */; }; 12 | 34857FB62283D65200B5F0ED /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34857FB52283D65200B5F0ED /* Assets.xcassets */; }; 13 | 34857FB92283D65200B5F0ED /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34857FB72283D65200B5F0ED /* LaunchScreen.storyboard */; }; 14 | 34857FBC2283D65200B5F0ED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FBB2283D65200B5F0ED /* main.m */; }; 15 | 34857FC62283D65200B5F0ED /* MultiProtocolManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FC52283D65200B5F0ED /* MultiProtocolManagerTests.m */; }; 16 | 34857FD12283D65200B5F0ED /* MultiProtocolManagerUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FD02283D65200B5F0ED /* MultiProtocolManagerUITests.m */; }; 17 | 34857FEB2283DF5E00B5F0ED /* ButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FE12283DF5E00B5F0ED /* ButtonView.m */; }; 18 | 34857FEC2283DF5E00B5F0ED /* TestView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FE22283DF5E00B5F0ED /* TestView.m */; }; 19 | 34857FED2283DF5E00B5F0ED /* SViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FE52283DF5E00B5F0ED /* SViewController.m */; }; 20 | 34857FEE2283DF5E00B5F0ED /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FE62283DF5E00B5F0ED /* ViewController.m */; }; 21 | 34857FEF2283DF5E00B5F0ED /* ThirdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FE92283DF5E00B5F0ED /* ThirdViewController.m */; }; 22 | 34857FF22283DFB500B5F0ED /* CYProtocolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 34857FF12283DFB500B5F0ED /* CYProtocolManager.m */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | 34857FC22283D65200B5F0ED /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = 34857FA12283D65100B5F0ED /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = 34857FA82283D65100B5F0ED; 31 | remoteInfo = MultiProtocolManager; 32 | }; 33 | 34857FCD2283D65200B5F0ED /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 34857FA12283D65100B5F0ED /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 34857FA82283D65100B5F0ED; 38 | remoteInfo = MultiProtocolManager; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 34857FA92283D65100B5F0ED /* MultiProtocolManager.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultiProtocolManager.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 34857FAC2283D65100B5F0ED /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 34857FAD2283D65100B5F0ED /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 34857FB32283D65100B5F0ED /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 47 | 34857FB52283D65200B5F0ED /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | 34857FB82283D65200B5F0ED /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | 34857FBA2283D65200B5F0ED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 34857FBB2283D65200B5F0ED /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 51 | 34857FC12283D65200B5F0ED /* MultiProtocolManagerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MultiProtocolManagerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 34857FC52283D65200B5F0ED /* MultiProtocolManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MultiProtocolManagerTests.m; sourceTree = ""; }; 53 | 34857FC72283D65200B5F0ED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 34857FCC2283D65200B5F0ED /* MultiProtocolManagerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MultiProtocolManagerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 34857FD02283D65200B5F0ED /* MultiProtocolManagerUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MultiProtocolManagerUITests.m; sourceTree = ""; }; 56 | 34857FD22283D65200B5F0ED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 34857FE02283DF5E00B5F0ED /* TestView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestView.h; sourceTree = ""; }; 58 | 34857FE12283DF5E00B5F0ED /* ButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ButtonView.m; sourceTree = ""; }; 59 | 34857FE22283DF5E00B5F0ED /* TestView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestView.m; sourceTree = ""; }; 60 | 34857FE32283DF5E00B5F0ED /* ButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonView.h; sourceTree = ""; }; 61 | 34857FE52283DF5E00B5F0ED /* SViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SViewController.m; sourceTree = ""; }; 62 | 34857FE62283DF5E00B5F0ED /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 63 | 34857FE72283DF5E00B5F0ED /* ThirdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThirdViewController.h; sourceTree = ""; }; 64 | 34857FE82283DF5E00B5F0ED /* SViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SViewController.h; sourceTree = ""; }; 65 | 34857FE92283DF5E00B5F0ED /* ThirdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThirdViewController.m; sourceTree = ""; }; 66 | 34857FEA2283DF5E00B5F0ED /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 67 | 34857FF02283DFB500B5F0ED /* CYProtocolManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CYProtocolManager.h; sourceTree = ""; }; 68 | 34857FF12283DFB500B5F0ED /* CYProtocolManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CYProtocolManager.m; sourceTree = ""; }; 69 | /* End PBXFileReference section */ 70 | 71 | /* Begin PBXFrameworksBuildPhase section */ 72 | 34857FA62283D65100B5F0ED /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | 34857FBE2283D65200B5F0ED /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | 34857FC92283D65200B5F0ED /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | /* End PBXFrameworksBuildPhase section */ 94 | 95 | /* Begin PBXGroup section */ 96 | 34857FA02283D65100B5F0ED = { 97 | isa = PBXGroup; 98 | children = ( 99 | 34857FAB2283D65100B5F0ED /* MultiProtocolManager */, 100 | 34857FC42283D65200B5F0ED /* MultiProtocolManagerTests */, 101 | 34857FCF2283D65200B5F0ED /* MultiProtocolManagerUITests */, 102 | 34857FAA2283D65100B5F0ED /* Products */, 103 | ); 104 | sourceTree = ""; 105 | }; 106 | 34857FAA2283D65100B5F0ED /* Products */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 34857FA92283D65100B5F0ED /* MultiProtocolManager.app */, 110 | 34857FC12283D65200B5F0ED /* MultiProtocolManagerTests.xctest */, 111 | 34857FCC2283D65200B5F0ED /* MultiProtocolManagerUITests.xctest */, 112 | ); 113 | name = Products; 114 | sourceTree = ""; 115 | }; 116 | 34857FAB2283D65100B5F0ED /* MultiProtocolManager */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 34857FDE2283D6EA00B5F0ED /* CYProtocolManager */, 120 | 34857FE42283DF5E00B5F0ED /* Controller */, 121 | 34857FDF2283DF5E00B5F0ED /* View */, 122 | 34857FAC2283D65100B5F0ED /* AppDelegate.h */, 123 | 34857FAD2283D65100B5F0ED /* AppDelegate.m */, 124 | 34857FB22283D65100B5F0ED /* Main.storyboard */, 125 | 34857FB52283D65200B5F0ED /* Assets.xcassets */, 126 | 34857FB72283D65200B5F0ED /* LaunchScreen.storyboard */, 127 | 34857FBA2283D65200B5F0ED /* Info.plist */, 128 | 34857FBB2283D65200B5F0ED /* main.m */, 129 | ); 130 | path = MultiProtocolManager; 131 | sourceTree = ""; 132 | }; 133 | 34857FC42283D65200B5F0ED /* MultiProtocolManagerTests */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 34857FC52283D65200B5F0ED /* MultiProtocolManagerTests.m */, 137 | 34857FC72283D65200B5F0ED /* Info.plist */, 138 | ); 139 | path = MultiProtocolManagerTests; 140 | sourceTree = ""; 141 | }; 142 | 34857FCF2283D65200B5F0ED /* MultiProtocolManagerUITests */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 34857FD02283D65200B5F0ED /* MultiProtocolManagerUITests.m */, 146 | 34857FD22283D65200B5F0ED /* Info.plist */, 147 | ); 148 | path = MultiProtocolManagerUITests; 149 | sourceTree = ""; 150 | }; 151 | 34857FDE2283D6EA00B5F0ED /* CYProtocolManager */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 34857FF02283DFB500B5F0ED /* CYProtocolManager.h */, 155 | 34857FF12283DFB500B5F0ED /* CYProtocolManager.m */, 156 | ); 157 | path = CYProtocolManager; 158 | sourceTree = ""; 159 | }; 160 | 34857FDF2283DF5E00B5F0ED /* View */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 34857FE02283DF5E00B5F0ED /* TestView.h */, 164 | 34857FE12283DF5E00B5F0ED /* ButtonView.m */, 165 | 34857FE22283DF5E00B5F0ED /* TestView.m */, 166 | 34857FE32283DF5E00B5F0ED /* ButtonView.h */, 167 | ); 168 | path = View; 169 | sourceTree = ""; 170 | }; 171 | 34857FE42283DF5E00B5F0ED /* Controller */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 34857FE82283DF5E00B5F0ED /* SViewController.h */, 175 | 34857FE52283DF5E00B5F0ED /* SViewController.m */, 176 | 34857FEA2283DF5E00B5F0ED /* ViewController.h */, 177 | 34857FE62283DF5E00B5F0ED /* ViewController.m */, 178 | 34857FE72283DF5E00B5F0ED /* ThirdViewController.h */, 179 | 34857FE92283DF5E00B5F0ED /* ThirdViewController.m */, 180 | ); 181 | path = Controller; 182 | sourceTree = ""; 183 | }; 184 | /* End PBXGroup section */ 185 | 186 | /* Begin PBXNativeTarget section */ 187 | 34857FA82283D65100B5F0ED /* MultiProtocolManager */ = { 188 | isa = PBXNativeTarget; 189 | buildConfigurationList = 34857FD52283D65200B5F0ED /* Build configuration list for PBXNativeTarget "MultiProtocolManager" */; 190 | buildPhases = ( 191 | 34857FA52283D65100B5F0ED /* Sources */, 192 | 34857FA62283D65100B5F0ED /* Frameworks */, 193 | 34857FA72283D65100B5F0ED /* Resources */, 194 | ); 195 | buildRules = ( 196 | ); 197 | dependencies = ( 198 | ); 199 | name = MultiProtocolManager; 200 | productName = MultiProtocolManager; 201 | productReference = 34857FA92283D65100B5F0ED /* MultiProtocolManager.app */; 202 | productType = "com.apple.product-type.application"; 203 | }; 204 | 34857FC02283D65200B5F0ED /* MultiProtocolManagerTests */ = { 205 | isa = PBXNativeTarget; 206 | buildConfigurationList = 34857FD82283D65200B5F0ED /* Build configuration list for PBXNativeTarget "MultiProtocolManagerTests" */; 207 | buildPhases = ( 208 | 34857FBD2283D65200B5F0ED /* Sources */, 209 | 34857FBE2283D65200B5F0ED /* Frameworks */, 210 | 34857FBF2283D65200B5F0ED /* Resources */, 211 | ); 212 | buildRules = ( 213 | ); 214 | dependencies = ( 215 | 34857FC32283D65200B5F0ED /* PBXTargetDependency */, 216 | ); 217 | name = MultiProtocolManagerTests; 218 | productName = MultiProtocolManagerTests; 219 | productReference = 34857FC12283D65200B5F0ED /* MultiProtocolManagerTests.xctest */; 220 | productType = "com.apple.product-type.bundle.unit-test"; 221 | }; 222 | 34857FCB2283D65200B5F0ED /* MultiProtocolManagerUITests */ = { 223 | isa = PBXNativeTarget; 224 | buildConfigurationList = 34857FDB2283D65200B5F0ED /* Build configuration list for PBXNativeTarget "MultiProtocolManagerUITests" */; 225 | buildPhases = ( 226 | 34857FC82283D65200B5F0ED /* Sources */, 227 | 34857FC92283D65200B5F0ED /* Frameworks */, 228 | 34857FCA2283D65200B5F0ED /* Resources */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | 34857FCE2283D65200B5F0ED /* PBXTargetDependency */, 234 | ); 235 | name = MultiProtocolManagerUITests; 236 | productName = MultiProtocolManagerUITests; 237 | productReference = 34857FCC2283D65200B5F0ED /* MultiProtocolManagerUITests.xctest */; 238 | productType = "com.apple.product-type.bundle.ui-testing"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | 34857FA12283D65100B5F0ED /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | LastUpgradeCheck = 1000; 247 | ORGANIZATIONNAME = cython; 248 | TargetAttributes = { 249 | 34857FA82283D65100B5F0ED = { 250 | CreatedOnToolsVersion = 10.0; 251 | }; 252 | 34857FC02283D65200B5F0ED = { 253 | CreatedOnToolsVersion = 10.0; 254 | TestTargetID = 34857FA82283D65100B5F0ED; 255 | }; 256 | 34857FCB2283D65200B5F0ED = { 257 | CreatedOnToolsVersion = 10.0; 258 | TestTargetID = 34857FA82283D65100B5F0ED; 259 | }; 260 | }; 261 | }; 262 | buildConfigurationList = 34857FA42283D65100B5F0ED /* Build configuration list for PBXProject "MultiProtocolManager" */; 263 | compatibilityVersion = "Xcode 9.3"; 264 | developmentRegion = en; 265 | hasScannedForEncodings = 0; 266 | knownRegions = ( 267 | en, 268 | Base, 269 | ); 270 | mainGroup = 34857FA02283D65100B5F0ED; 271 | productRefGroup = 34857FAA2283D65100B5F0ED /* Products */; 272 | projectDirPath = ""; 273 | projectRoot = ""; 274 | targets = ( 275 | 34857FA82283D65100B5F0ED /* MultiProtocolManager */, 276 | 34857FC02283D65200B5F0ED /* MultiProtocolManagerTests */, 277 | 34857FCB2283D65200B5F0ED /* MultiProtocolManagerUITests */, 278 | ); 279 | }; 280 | /* End PBXProject section */ 281 | 282 | /* Begin PBXResourcesBuildPhase section */ 283 | 34857FA72283D65100B5F0ED /* Resources */ = { 284 | isa = PBXResourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 34857FB92283D65200B5F0ED /* LaunchScreen.storyboard in Resources */, 288 | 34857FB62283D65200B5F0ED /* Assets.xcassets in Resources */, 289 | 34857FB42283D65100B5F0ED /* Main.storyboard in Resources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | 34857FBF2283D65200B5F0ED /* Resources */ = { 294 | isa = PBXResourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | 34857FCA2283D65200B5F0ED /* Resources */ = { 301 | isa = PBXResourcesBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | /* End PBXResourcesBuildPhase section */ 308 | 309 | /* Begin PBXSourcesBuildPhase section */ 310 | 34857FA52283D65100B5F0ED /* Sources */ = { 311 | isa = PBXSourcesBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | 34857FEE2283DF5E00B5F0ED /* ViewController.m in Sources */, 315 | 34857FED2283DF5E00B5F0ED /* SViewController.m in Sources */, 316 | 34857FEC2283DF5E00B5F0ED /* TestView.m in Sources */, 317 | 34857FBC2283D65200B5F0ED /* main.m in Sources */, 318 | 34857FEB2283DF5E00B5F0ED /* ButtonView.m in Sources */, 319 | 34857FAE2283D65100B5F0ED /* AppDelegate.m in Sources */, 320 | 34857FEF2283DF5E00B5F0ED /* ThirdViewController.m in Sources */, 321 | 34857FF22283DFB500B5F0ED /* CYProtocolManager.m in Sources */, 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | }; 325 | 34857FBD2283D65200B5F0ED /* Sources */ = { 326 | isa = PBXSourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | 34857FC62283D65200B5F0ED /* MultiProtocolManagerTests.m in Sources */, 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | 34857FC82283D65200B5F0ED /* Sources */ = { 334 | isa = PBXSourcesBuildPhase; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | 34857FD12283D65200B5F0ED /* MultiProtocolManagerUITests.m in Sources */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | /* End PBXSourcesBuildPhase section */ 342 | 343 | /* Begin PBXTargetDependency section */ 344 | 34857FC32283D65200B5F0ED /* PBXTargetDependency */ = { 345 | isa = PBXTargetDependency; 346 | target = 34857FA82283D65100B5F0ED /* MultiProtocolManager */; 347 | targetProxy = 34857FC22283D65200B5F0ED /* PBXContainerItemProxy */; 348 | }; 349 | 34857FCE2283D65200B5F0ED /* PBXTargetDependency */ = { 350 | isa = PBXTargetDependency; 351 | target = 34857FA82283D65100B5F0ED /* MultiProtocolManager */; 352 | targetProxy = 34857FCD2283D65200B5F0ED /* PBXContainerItemProxy */; 353 | }; 354 | /* End PBXTargetDependency section */ 355 | 356 | /* Begin PBXVariantGroup section */ 357 | 34857FB22283D65100B5F0ED /* Main.storyboard */ = { 358 | isa = PBXVariantGroup; 359 | children = ( 360 | 34857FB32283D65100B5F0ED /* Base */, 361 | ); 362 | name = Main.storyboard; 363 | sourceTree = ""; 364 | }; 365 | 34857FB72283D65200B5F0ED /* LaunchScreen.storyboard */ = { 366 | isa = PBXVariantGroup; 367 | children = ( 368 | 34857FB82283D65200B5F0ED /* Base */, 369 | ); 370 | name = LaunchScreen.storyboard; 371 | sourceTree = ""; 372 | }; 373 | /* End PBXVariantGroup section */ 374 | 375 | /* Begin XCBuildConfiguration section */ 376 | 34857FD32283D65200B5F0ED /* 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 | CODE_SIGN_IDENTITY = "iPhone Developer"; 409 | COPY_PHASE_STRIP = NO; 410 | DEBUG_INFORMATION_FORMAT = dwarf; 411 | ENABLE_STRICT_OBJC_MSGSEND = YES; 412 | ENABLE_TESTABILITY = YES; 413 | GCC_C_LANGUAGE_STANDARD = gnu11; 414 | GCC_DYNAMIC_NO_PIC = NO; 415 | GCC_NO_COMMON_BLOCKS = YES; 416 | GCC_OPTIMIZATION_LEVEL = 0; 417 | GCC_PREPROCESSOR_DEFINITIONS = ( 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 = 12.0; 428 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 429 | MTL_FAST_MATH = YES; 430 | ONLY_ACTIVE_ARCH = YES; 431 | SDKROOT = iphoneos; 432 | }; 433 | name = Debug; 434 | }; 435 | 34857FD42283D65200B5F0ED /* Release */ = { 436 | isa = XCBuildConfiguration; 437 | buildSettings = { 438 | ALWAYS_SEARCH_USER_PATHS = NO; 439 | CLANG_ANALYZER_NONNULL = YES; 440 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 441 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 442 | CLANG_CXX_LIBRARY = "libc++"; 443 | CLANG_ENABLE_MODULES = YES; 444 | CLANG_ENABLE_OBJC_ARC = YES; 445 | CLANG_ENABLE_OBJC_WEAK = YES; 446 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 447 | CLANG_WARN_BOOL_CONVERSION = YES; 448 | CLANG_WARN_COMMA = YES; 449 | CLANG_WARN_CONSTANT_CONVERSION = YES; 450 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 451 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 452 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 453 | CLANG_WARN_EMPTY_BODY = YES; 454 | CLANG_WARN_ENUM_CONVERSION = YES; 455 | CLANG_WARN_INFINITE_RECURSION = YES; 456 | CLANG_WARN_INT_CONVERSION = YES; 457 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 458 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 459 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 460 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 461 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 462 | CLANG_WARN_STRICT_PROTOTYPES = YES; 463 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 464 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 465 | CLANG_WARN_UNREACHABLE_CODE = YES; 466 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 467 | CODE_SIGN_IDENTITY = "iPhone Developer"; 468 | COPY_PHASE_STRIP = NO; 469 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 470 | ENABLE_NS_ASSERTIONS = NO; 471 | ENABLE_STRICT_OBJC_MSGSEND = YES; 472 | GCC_C_LANGUAGE_STANDARD = gnu11; 473 | GCC_NO_COMMON_BLOCKS = YES; 474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 476 | GCC_WARN_UNDECLARED_SELECTOR = YES; 477 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 478 | GCC_WARN_UNUSED_FUNCTION = YES; 479 | GCC_WARN_UNUSED_VARIABLE = YES; 480 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 481 | MTL_ENABLE_DEBUG_INFO = NO; 482 | MTL_FAST_MATH = YES; 483 | SDKROOT = iphoneos; 484 | VALIDATE_PRODUCT = YES; 485 | }; 486 | name = Release; 487 | }; 488 | 34857FD62283D65200B5F0ED /* Debug */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 492 | CODE_SIGN_STYLE = Automatic; 493 | INFOPLIST_FILE = MultiProtocolManager/Info.plist; 494 | LD_RUNPATH_SEARCH_PATHS = ( 495 | "$(inherited)", 496 | "@executable_path/Frameworks", 497 | ); 498 | PRODUCT_BUNDLE_IDENTIFIER = cy.com.MultiProtocolManager; 499 | PRODUCT_NAME = "$(TARGET_NAME)"; 500 | TARGETED_DEVICE_FAMILY = "1,2"; 501 | }; 502 | name = Debug; 503 | }; 504 | 34857FD72283D65200B5F0ED /* Release */ = { 505 | isa = XCBuildConfiguration; 506 | buildSettings = { 507 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 508 | CODE_SIGN_STYLE = Automatic; 509 | INFOPLIST_FILE = MultiProtocolManager/Info.plist; 510 | LD_RUNPATH_SEARCH_PATHS = ( 511 | "$(inherited)", 512 | "@executable_path/Frameworks", 513 | ); 514 | PRODUCT_BUNDLE_IDENTIFIER = cy.com.MultiProtocolManager; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | TARGETED_DEVICE_FAMILY = "1,2"; 517 | }; 518 | name = Release; 519 | }; 520 | 34857FD92283D65200B5F0ED /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | BUNDLE_LOADER = "$(TEST_HOST)"; 524 | CODE_SIGN_STYLE = Automatic; 525 | INFOPLIST_FILE = MultiProtocolManagerTests/Info.plist; 526 | LD_RUNPATH_SEARCH_PATHS = ( 527 | "$(inherited)", 528 | "@executable_path/Frameworks", 529 | "@loader_path/Frameworks", 530 | ); 531 | PRODUCT_BUNDLE_IDENTIFIER = cy.com.MultiProtocolManagerTests; 532 | PRODUCT_NAME = "$(TARGET_NAME)"; 533 | TARGETED_DEVICE_FAMILY = "1,2"; 534 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MultiProtocolManager.app/MultiProtocolManager"; 535 | }; 536 | name = Debug; 537 | }; 538 | 34857FDA2283D65200B5F0ED /* Release */ = { 539 | isa = XCBuildConfiguration; 540 | buildSettings = { 541 | BUNDLE_LOADER = "$(TEST_HOST)"; 542 | CODE_SIGN_STYLE = Automatic; 543 | INFOPLIST_FILE = MultiProtocolManagerTests/Info.plist; 544 | LD_RUNPATH_SEARCH_PATHS = ( 545 | "$(inherited)", 546 | "@executable_path/Frameworks", 547 | "@loader_path/Frameworks", 548 | ); 549 | PRODUCT_BUNDLE_IDENTIFIER = cy.com.MultiProtocolManagerTests; 550 | PRODUCT_NAME = "$(TARGET_NAME)"; 551 | TARGETED_DEVICE_FAMILY = "1,2"; 552 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MultiProtocolManager.app/MultiProtocolManager"; 553 | }; 554 | name = Release; 555 | }; 556 | 34857FDC2283D65200B5F0ED /* Debug */ = { 557 | isa = XCBuildConfiguration; 558 | buildSettings = { 559 | CODE_SIGN_STYLE = Automatic; 560 | INFOPLIST_FILE = MultiProtocolManagerUITests/Info.plist; 561 | LD_RUNPATH_SEARCH_PATHS = ( 562 | "$(inherited)", 563 | "@executable_path/Frameworks", 564 | "@loader_path/Frameworks", 565 | ); 566 | PRODUCT_BUNDLE_IDENTIFIER = cy.com.MultiProtocolManagerUITests; 567 | PRODUCT_NAME = "$(TARGET_NAME)"; 568 | TARGETED_DEVICE_FAMILY = "1,2"; 569 | TEST_TARGET_NAME = MultiProtocolManager; 570 | }; 571 | name = Debug; 572 | }; 573 | 34857FDD2283D65200B5F0ED /* Release */ = { 574 | isa = XCBuildConfiguration; 575 | buildSettings = { 576 | CODE_SIGN_STYLE = Automatic; 577 | INFOPLIST_FILE = MultiProtocolManagerUITests/Info.plist; 578 | LD_RUNPATH_SEARCH_PATHS = ( 579 | "$(inherited)", 580 | "@executable_path/Frameworks", 581 | "@loader_path/Frameworks", 582 | ); 583 | PRODUCT_BUNDLE_IDENTIFIER = cy.com.MultiProtocolManagerUITests; 584 | PRODUCT_NAME = "$(TARGET_NAME)"; 585 | TARGETED_DEVICE_FAMILY = "1,2"; 586 | TEST_TARGET_NAME = MultiProtocolManager; 587 | }; 588 | name = Release; 589 | }; 590 | /* End XCBuildConfiguration section */ 591 | 592 | /* Begin XCConfigurationList section */ 593 | 34857FA42283D65100B5F0ED /* Build configuration list for PBXProject "MultiProtocolManager" */ = { 594 | isa = XCConfigurationList; 595 | buildConfigurations = ( 596 | 34857FD32283D65200B5F0ED /* Debug */, 597 | 34857FD42283D65200B5F0ED /* Release */, 598 | ); 599 | defaultConfigurationIsVisible = 0; 600 | defaultConfigurationName = Release; 601 | }; 602 | 34857FD52283D65200B5F0ED /* Build configuration list for PBXNativeTarget "MultiProtocolManager" */ = { 603 | isa = XCConfigurationList; 604 | buildConfigurations = ( 605 | 34857FD62283D65200B5F0ED /* Debug */, 606 | 34857FD72283D65200B5F0ED /* Release */, 607 | ); 608 | defaultConfigurationIsVisible = 0; 609 | defaultConfigurationName = Release; 610 | }; 611 | 34857FD82283D65200B5F0ED /* Build configuration list for PBXNativeTarget "MultiProtocolManagerTests" */ = { 612 | isa = XCConfigurationList; 613 | buildConfigurations = ( 614 | 34857FD92283D65200B5F0ED /* Debug */, 615 | 34857FDA2283D65200B5F0ED /* Release */, 616 | ); 617 | defaultConfigurationIsVisible = 0; 618 | defaultConfigurationName = Release; 619 | }; 620 | 34857FDB2283D65200B5F0ED /* Build configuration list for PBXNativeTarget "MultiProtocolManagerUITests" */ = { 621 | isa = XCConfigurationList; 622 | buildConfigurations = ( 623 | 34857FDC2283D65200B5F0ED /* Debug */, 624 | 34857FDD2283D65200B5F0ED /* Release */, 625 | ); 626 | defaultConfigurationIsVisible = 0; 627 | defaultConfigurationName = Release; 628 | }; 629 | /* End XCConfigurationList section */ 630 | }; 631 | rootObject = 34857FA12283D65100B5F0ED /* Project object */; 632 | } 633 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager.xcodeproj/project.xcworkspace/xcuserdata/cython.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NullWorld/multi-protocol-manager/d29d228c2a6a6ead23fefcc7da79373832dd641c/MultiProtocolManager/MultiProtocolManager.xcodeproj/project.xcworkspace/xcuserdata/cython.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager.xcodeproj/xcuserdata/cython.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager.xcodeproj/xcuserdata/cython.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MultiProtocolManager.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | MultiProtocolManager.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MultiProtocolManager 4 | // 5 | // Created by 尚宇 on 2019/5/9. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MultiProtocolManager 4 | // 5 | // Created by 尚宇 on 2019/5/9. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/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 | } -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/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 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/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 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/CYProtocolManager/CYProtocolManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYProtocolManager.h 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CYProtocolManager : NSObject 14 | 15 | //单例 16 | + (instancetype)share; 17 | 18 | //添加代理对象和协议名称(一般为协议名称) 19 | - (void)addDelegateTarget:(id)target withProtcol:(id)protocol; 20 | 21 | //移除确定不使用的协议 22 | - (void)removeDelegateProtocol:(id)protocol; 23 | 24 | //移除所有的类 25 | - (void)removeAll; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/CYProtocolManager/CYProtocolManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYProtocolManager.m 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "CYProtocolManager.h" 10 | #import 11 | #import 12 | 13 | @interface CYProtocolManager() 14 | 15 | @property (nonatomic,strong) NSMutableDictionary *refTargets; 16 | 17 | @property (nonatomic,strong) NSPointerArray *targets; 18 | 19 | @end 20 | 21 | @implementation CYProtocolManager 22 | 23 | static CYProtocolManager *manager = nil; 24 | 25 | + (instancetype)share{ 26 | if (!manager) { 27 | manager = [[CYProtocolManager alloc] init]; 28 | } 29 | return manager; 30 | } 31 | 32 | - (void)addDelegateTarget:(id)target withProtcol:(id)protocol{ 33 | 34 | if (![self.refTargets.allKeys containsObject:protocol]) { 35 | 36 | NSPointerArray *targets = [NSPointerArray weakObjectsPointerArray]; 37 | [targets addPointer:(__bridge void * _Nullable)(target)]; 38 | [self.refTargets setObject:targets forKey:protocol]; 39 | 40 | }else{ 41 | NSPointerArray *targets = [self.refTargets objectForKey:protocol]; 42 | 43 | if ([targets.allObjects containsObject:target]) {return;} 44 | 45 | [targets addPointer:(__bridge void * _Nullable)(target)]; 46 | } 47 | 48 | } 49 | 50 | - (void)removeDelegateProtocol:(id)protocol{ 51 | if ([self.refTargets.allKeys containsObject:protocol]) { 52 | [_refTargets removeObjectForKey:protocol]; 53 | } 54 | } 55 | 56 | - (void)removeAll{ 57 | [self.refTargets removeAllObjects]; 58 | } 59 | 60 | 61 | - (BOOL)respondsToSelector:(SEL)aSelector { 62 | if ([super respondsToSelector:aSelector]) { 63 | return YES; 64 | } 65 | 66 | for (id key in self.refTargets.allKeys) { 67 | NSPointerArray *targets = [self.refTargets objectForKey:key]; 68 | for (id obj in targets) { 69 | if ([obj respondsToSelector:aSelector]) { 70 | return YES; 71 | } 72 | } 73 | } 74 | return NO; 75 | } 76 | 77 | 78 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 79 | NSMethodSignature *sig = [super methodSignatureForSelector:aSelector]; 80 | if (!sig) { 81 | 82 | for (id key in self.refTargets.allKeys) { 83 | NSPointerArray *targets = [self.refTargets objectForKey:key]; 84 | for (id obj in targets) { 85 | if ((sig = [obj methodSignatureForSelector:aSelector])) { 86 | break; 87 | } 88 | } 89 | } 90 | 91 | } 92 | return sig; 93 | } 94 | 95 | //方法转发 96 | - (void)forwardInvocation:(NSInvocation *)anInvocation { 97 | for (NSString* key in self.refTargets.allKeys) { 98 | NSPointerArray *targets = [self.refTargets objectForKey:key]; 99 | const char *name = [key UTF8String]; 100 | Protocol *protocol = objc_getProtocol(name); 101 | NSAssert(protocol!=nil, @"不存在的协议"); 102 | struct objc_method_description protocol_method_description = protocol_getMethodDescription(protocol, anInvocation.selector, YES, YES); 103 | 104 | // NSLog(@"===%@==%s=",NSStringFromSelector(protocol_method_description.name),protocol_method_description.types); 105 | if (protocol_method_description.name!=nil) { 106 | for (id obj in targets) { 107 | if ([obj respondsToSelector:anInvocation.selector]) { 108 | [anInvocation invokeWithTarget:obj]; 109 | } 110 | } 111 | } 112 | 113 | } 114 | } 115 | 116 | 117 | 118 | - (NSMutableDictionary *)refTargets{ 119 | if (!_refTargets) { 120 | _refTargets = [[NSMutableDictionary alloc] init]; 121 | } 122 | return _refTargets; 123 | } 124 | 125 | - (NSMutableArray *)targets{ 126 | if (!_targets) { 127 | _targets = [[NSMutableArray alloc] init]; 128 | } 129 | return _targets; 130 | } 131 | 132 | 133 | - (Class)getMeterClassObjc:(id)objc{ 134 | return object_getClass(objc); 135 | } 136 | 137 | //给objc的deallocz转发一个新方法 138 | - (void)cy_dealloc{ 139 | NSLog(@"=====%s====",__func__); 140 | } 141 | 142 | static void cy_dealloc(id self ,SEL _cmd){ 143 | NSLog(@"====%s=%@=",__func__,self); 144 | } 145 | 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Controller/SViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SViewController.h 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Controller/SViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SViewController.m 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "SViewController.h" 10 | #import "TestView.h" 11 | #import "CYProtocolManager.h" 12 | #import "ThirdViewController.h" 13 | #import 14 | 15 | @interface SViewController () 16 | 17 | @end 18 | 19 | @implementation SViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | self.title = NSStringFromClass(self.class); 24 | self.view.backgroundColor = [UIColor whiteColor]; 25 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(200, 200, 120, 50)]; 26 | [btn addTarget:self action:@selector(persentView) forControlEvents:UIControlEventTouchUpInside]; 27 | btn.backgroundColor = [UIColor blueColor]; 28 | [self.view addSubview:btn]; 29 | 30 | UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(50, 200, 120, 50)]; 31 | [btn1 addTarget:self action:@selector(push) forControlEvents:UIControlEventTouchUpInside]; 32 | btn1.backgroundColor = [UIColor blueColor]; 33 | [self.view addSubview:btn1]; 34 | method_exchangeImplementations(class_getInstanceMethod(self.class, NSSelectorFromString(@"dealloc")), class_getInstanceMethod(self.class, NSSelectorFromString(@"cy_dealloc"))); 35 | TestView *view = [[TestView alloc] initWithFrame:CGRectMake(200, 400, 120, 50)]; 36 | [self.view addSubview:view]; 37 | view.backgroundColor = [UIColor redColor]; 38 | CYProtocolManager *manager = [CYProtocolManager share]; 39 | [manager addDelegateTarget:self withProtcol:@"TestViewBtnDelegate"]; 40 | view.btnDelegate = manager; 41 | 42 | Method deallocMethod = class_getInstanceMethod(self.class, NSSelectorFromString(@"dealloc")); 43 | const char *types = method_getTypeEncoding(deallocMethod); 44 | 45 | BOOL xxx = class_addMethod(self.class, NSSelectorFromString(@"dealloc"),(IMP) cy_dealloc, types); 46 | } 47 | 48 | - (void)push{ 49 | [self.navigationController pushViewController:[ThirdViewController new] animated:true]; 50 | } 51 | 52 | - (void)persentView{ 53 | [self.navigationController popViewControllerAnimated:true]; 54 | } 55 | - (void)dealloc{ 56 | NSLog(@"==%s=dealloc===",__func__); 57 | } 58 | /* 59 | #pragma mark - Navigation 60 | 61 | // In a storyboard-based application, you will often want to do a little preparation before navigation 62 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 63 | // Get the new view controller using [segue destinationViewController]. 64 | // Pass the selected object to the new view controller. 65 | } 66 | */ 67 | 68 | - (void)tapView:(UIView *)view{ 69 | NSLog(@"==%s==%@==",__func__,view); 70 | } 71 | 72 | - (void)tapBtn:(UIButton *)btn{ 73 | NSLog(@"==%s==%@==",__func__,btn); 74 | } 75 | 76 | //给objc的deallocz转发一个新方法 77 | - (void)cy_dealloc{ 78 | NSLog(@"=====%s====",__func__); 79 | } 80 | 81 | static void cy_dealloc(id self ,SEL _cmd){ 82 | NSLog(@"====%s=%@=",__func__,self); 83 | } 84 | 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Controller/ThirdViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.h 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ThirdViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Controller/ThirdViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.m 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "ThirdViewController.h" 10 | #import "SViewController.h" 11 | #import "CYProtocolManager.h" 12 | #import "TestView.h" 13 | 14 | @interface ThirdViewController () 15 | 16 | @end 17 | 18 | @implementation ThirdViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.title = NSStringFromClass(self.class); 23 | self.view.backgroundColor = [UIColor whiteColor]; 24 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(200, 200, 120, 50)]; 25 | [btn addTarget:self action:@selector(persentView) forControlEvents:UIControlEventTouchUpInside]; 26 | btn.backgroundColor = [UIColor blueColor]; 27 | [self.view addSubview:btn]; 28 | 29 | TestView *view = [[TestView alloc] initWithFrame:CGRectMake(200, 400, 120, 50)]; 30 | view.backgroundColor = [UIColor yellowColor]; 31 | [self.view addSubview:view]; 32 | 33 | CYProtocolManager *manager = [CYProtocolManager share]; 34 | [manager addDelegateTarget:self withProtcol:@"TestViewBtnDelegate"]; 35 | view.btnDelegate = (id) manager; 36 | } 37 | 38 | 39 | - (void)tapView:(UIView *)view{ 40 | NSLog(@"==%s==%@==",__func__,view); 41 | } 42 | 43 | - (void)tapBtn:(UIButton *)btn{ 44 | NSLog(@"==%s==%@==",__func__,btn); 45 | } 46 | 47 | - (void)printDescrtion{ 48 | NSLog(@"asdasdasdasda"); 49 | } 50 | 51 | - (void)dealloc{ 52 | NSLog(@"===%s==",__func__); 53 | } 54 | 55 | - (void)persentView{ 56 | [self.navigationController popToRootViewControllerAnimated:true]; 57 | } 58 | 59 | /* 60 | #pragma mark - Navigation 61 | 62 | // In a storyboard-based application, you will often want to do a little preparation before navigation 63 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 64 | // Get the new view controller using [segue destinationViewController]. 65 | // Pass the selected object to the new view controller. 66 | } 67 | */ 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Controller/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Controller/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "SViewController.h" 11 | #import "CYProtocolManager.h" 12 | #import "TestView.h" 13 | #import "ButtonView.h" 14 | 15 | 16 | @interface ViewController () 17 | 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | self.title = NSStringFromClass(self.class); 26 | 27 | self.view.backgroundColor = [UIColor whiteColor]; 28 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(200, 200, 120, 50)]; 29 | [btn addTarget:self action:@selector(persentView) forControlEvents:UIControlEventTouchUpInside]; 30 | btn.backgroundColor = [UIColor blueColor]; 31 | [self.view addSubview:btn]; 32 | 33 | TestView *view = [[TestView alloc] initWithFrame:CGRectMake(200, 400, 120, 50)]; 34 | view.backgroundColor = [UIColor yellowColor]; 35 | [self.view addSubview:view]; 36 | 37 | CYProtocolManager *manager = [CYProtocolManager share]; 38 | [manager addDelegateTarget:self withProtcol:@"TestViewBtnDelegate"]; 39 | view.btnDelegate = (id)manager; 40 | 41 | ButtonView *btnView = [[ButtonView alloc] initWithFrame:CGRectMake(200, 600, 120, 50)]; 42 | btnView.backgroundColor = [UIColor grayColor]; 43 | [self.view addSubview:btnView]; 44 | btnView.delegate = (id)manager; 45 | } 46 | 47 | - (void)persentView{ 48 | [self.navigationController pushViewController:[SViewController new] animated:true]; 49 | } 50 | - (void)dealloc{ 51 | NSLog(@"==%s=dealloc===",__func__); 52 | } 53 | 54 | - (void)tapView:(UIView *)view{ 55 | NSLog(@"==%s==%@==",__func__,view); 56 | } 57 | 58 | - (void)tapBtn:(UIButton *)btn{ 59 | NSLog(@"==%s==%@==",__func__,btn); 60 | } 61 | 62 | - (void)printDescrtion{ 63 | NSLog(@"asdasdasdasda"); 64 | } 65 | 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/View/ButtonView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ButtonView.h 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/9. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol TestViewDelegate 14 | 15 | - (void)tapView:(UIView *)view; 16 | 17 | - (void)printDescrtion; 18 | 19 | @end 20 | 21 | @interface ButtonView : UIView 22 | 23 | @property (nonatomic,weak)iddelegate; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/View/ButtonView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ButtonView.m 3 | // deleacVC 4 | // 5 | // Created by 尚宇 on 2019/5/9. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "ButtonView.h" 10 | 11 | @implementation ButtonView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame{ 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width/2, self.bounds.size.height)]; 17 | btn.backgroundColor = [UIColor redColor]; 18 | [btn addTarget:self action:@selector(delegateSelector) forControlEvents:UIControlEventTouchUpInside]; 19 | [self addSubview:btn]; 20 | 21 | UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(self.bounds.size.width/2, 0, self.bounds.size.width/2, self.bounds.size.height)]; 22 | btn2.backgroundColor = [UIColor blueColor]; 23 | [self addSubview:btn2]; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)delegateSelector{ 29 | if ([_delegate respondsToSelector:@selector(tapView:)]) { 30 | [_delegate tapView:self]; 31 | } 32 | 33 | if ([_delegate respondsToSelector:@selector(printDescrtion)]) { 34 | [_delegate printDescrtion]; 35 | } 36 | 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/View/TestView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestView.h 3 | // runTimer 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | //@protocol TestViewDelegate 14 | // 15 | //- (void)tapView:(UIView *)view; 16 | // 17 | //- (void)printDescrtion; 18 | // 19 | //@end 20 | 21 | @protocol TestViewBtnDelegate 22 | 23 | - (void)tapBtn:(UIButton*)btn; 24 | 25 | @end 26 | 27 | @interface TestView : UIView 28 | 29 | 30 | //@property (nonatomic,weak)iddelegate; 31 | 32 | @property (nonatomic,weak)idbtnDelegate; 33 | 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/View/TestView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestView.m 3 | // runTimer 4 | // 5 | // Created by 尚宇 on 2019/5/8. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import "TestView.h" 10 | 11 | @implementation TestView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame{ 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width/2, self.bounds.size.height)]; 17 | btn.backgroundColor = [UIColor redColor]; 18 | [btn addTarget:self action:@selector(delegateSelector) forControlEvents:UIControlEventTouchUpInside]; 19 | [self addSubview:btn]; 20 | 21 | UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(self.bounds.size.width/2, 0, self.bounds.size.width/2, self.bounds.size.height)]; 22 | btn2.backgroundColor = [UIColor blueColor]; 23 | [btn2 addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside]; 24 | [self addSubview:btn2]; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)delegateSelector{ 30 | // if ([_delegate respondsToSelector:@selector(tapView:)]) { 31 | // [_delegate tapView:self]; 32 | // } 33 | // 34 | // if ([_delegate respondsToSelector:@selector(printDescrtion)]) { 35 | // [_delegate printDescrtion]; 36 | // } 37 | 38 | } 39 | 40 | - (void)clickBtn:(UIButton *)sender{ 41 | if ([_btnDelegate respondsToSelector:@selector(tapBtn:)]) { 42 | [_btnDelegate tapBtn:sender]; 43 | } 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManager/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MultiProtocolManager 4 | // 5 | // Created by 尚宇 on 2019/5/9. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManagerTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManagerTests/MultiProtocolManagerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MultiProtocolManagerTests.m 3 | // MultiProtocolManagerTests 4 | // 5 | // Created by 尚宇 on 2019/5/9. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MultiProtocolManagerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MultiProtocolManagerTests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | } 20 | 21 | - (void)tearDown { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | - (void)testExample { 26 | // This is an example of a functional test case. 27 | // Use XCTAssert and related functions to verify your tests produce the correct results. 28 | } 29 | 30 | - (void)testPerformanceExample { 31 | // This is an example of a performance test case. 32 | [self measureBlock:^{ 33 | // Put the code you want to measure the time of here. 34 | }]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManagerUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /MultiProtocolManager/MultiProtocolManagerUITests/MultiProtocolManagerUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MultiProtocolManagerUITests.m 3 | // MultiProtocolManagerUITests 4 | // 5 | // Created by 尚宇 on 2019/5/9. 6 | // Copyright © 2019 cython. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MultiProtocolManagerUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MultiProtocolManagerUITests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | 20 | // In UI tests it is usually best to stop immediately when a failure occurs. 21 | self.continueAfterFailure = NO; 22 | 23 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 24 | [[[XCUIApplication alloc] init] launch]; 25 | 26 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 27 | } 28 | 29 | - (void)tearDown { 30 | // Put teardown code here. This method is called after the invocation of each test method in the class. 31 | } 32 | 33 | - (void)testExample { 34 | // Use recording to get started writing UI tests. 35 | // Use XCTAssert and related functions to verify your tests produce the correct results. 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # multi-protocol-manager 2 | 关于实现多重协议的方式,可以实现一对多的代理模式。 3 | 因为通知的一对多实现会产生内存泄漏、耦合关系太离散等一系列问题,有了想用代理实现一对多的方式通知。 4 | 首先,我们要满足的条件是多处服从协议的类实现代理方法 5 | 在触发其中一个代理,及即触发其他同一实现了的代理方法。 6 | 即完成了一对多的实现。 7 | 8 | ![Image text](https://img-blog.csdnimg.cn/20190509141654495.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3NoYW5neTExMA==,size_16,color_FFFFFF,t_70) 9 | 10 | 11 | 其中两个关键点在于 12 | 1、协议名称和对象构成的一个键值对,形成1-1对应关系 13 | 2、NSPointerArray的使用,使得弱引用对象,且在对象释放时自动删除NSPointerArray中的元素。当然这里也可以使用NSHashTable有一样的效果。 14 | 15 | 其实这里可以变成多对多的方式,而且在协议名重复也不会混淆。 16 | Demo中包含的例子。 17 | ViewController中代理了TestView中的TestViewDelegate 18 | ButtonView中的TestViewDelegate 19 | SViewController中代理TestView中的TestViewBtnDelegate 20 | 21 | ThirdViewController中代理了TestView中的TestViewDelegate 22 | TestView中的TestViewBtnDelegate 23 | 所以在点击TestView红色区域时,实现的ViewController和ThirdViewController中的TestViewDelegate的代理方法。 24 | 点击蓝色区域实现的是SViewController和ThirdViewController的代理方法。 25 | --------------------- 26 | 作者:shangy110 27 | 来源:CSDN 28 | 原文:https://blog.csdn.net/shangy110/article/details/90032739 29 | 版权声明:本文为博主原创文章,转载请附上博文链接! 30 | --------------------------------------------------------------------------------