├── README.md ├── TDProxyDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── jojoting.xcuserdatad │ └── xcschemes │ ├── TDProxyDemo.xcscheme │ └── xcschememanagement.plist ├── TDProxyDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── TDBookProvider.h ├── TDBookProvider.m ├── TDClothesProvider.h ├── TDClothesProvider.m ├── TDDealerProxy.h ├── TDDealerProxy.m ├── ViewController.h ├── ViewController.m └── main.m ├── TDProxyDemoTests ├── Info.plist └── TDProxyDemoTests.m └── TDProxyDemoUITests ├── Info.plist └── TDProxyDemoUITests.m /README.md: -------------------------------------------------------------------------------- 1 | # TDProxyDemo 2 | 3 | A demo of Multiple-Inheritance feature implemented with NSProxy class using Objective-C 4 | -------------------------------------------------------------------------------- /TDProxyDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B95877921D53935D0011ACE9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877911D53935D0011ACE9 /* main.m */; }; 11 | B95877951D53935D0011ACE9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877941D53935D0011ACE9 /* AppDelegate.m */; }; 12 | B95877981D53935D0011ACE9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877971D53935D0011ACE9 /* ViewController.m */; }; 13 | B958779B1D53935D0011ACE9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B95877991D53935D0011ACE9 /* Main.storyboard */; }; 14 | B958779D1D53935D0011ACE9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B958779C1D53935D0011ACE9 /* Assets.xcassets */; }; 15 | B95877A01D53935D0011ACE9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B958779E1D53935D0011ACE9 /* LaunchScreen.storyboard */; }; 16 | B95877AB1D53935D0011ACE9 /* TDProxyDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877AA1D53935D0011ACE9 /* TDProxyDemoTests.m */; }; 17 | B95877B61D53935D0011ACE9 /* TDProxyDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877B51D53935D0011ACE9 /* TDProxyDemoUITests.m */; }; 18 | B95877C51D53A0410011ACE9 /* TDDealerProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877C41D53A0410011ACE9 /* TDDealerProxy.m */; }; 19 | B95877D41D54FF180011ACE9 /* TDBookProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877D31D54FF180011ACE9 /* TDBookProvider.m */; }; 20 | B95877D71D54FF7E0011ACE9 /* TDClothesProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = B95877D61D54FF7E0011ACE9 /* TDClothesProvider.m */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | B95877A71D53935D0011ACE9 /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = B95877851D53935D0011ACE9 /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = B958778C1D53935D0011ACE9; 29 | remoteInfo = TDProxyDemo; 30 | }; 31 | B95877B21D53935D0011ACE9 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = B95877851D53935D0011ACE9 /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = B958778C1D53935D0011ACE9; 36 | remoteInfo = TDProxyDemo; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | B958778D1D53935D0011ACE9 /* TDProxyDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TDProxyDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | B95877911D53935D0011ACE9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 43 | B95877931D53935D0011ACE9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 44 | B95877941D53935D0011ACE9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 45 | B95877961D53935D0011ACE9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 46 | B95877971D53935D0011ACE9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 47 | B958779A1D53935D0011ACE9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 48 | B958779C1D53935D0011ACE9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 49 | B958779F1D53935D0011ACE9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 50 | B95877A11D53935D0011ACE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | B95877A61D53935D0011ACE9 /* TDProxyDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TDProxyDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | B95877AA1D53935D0011ACE9 /* TDProxyDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TDProxyDemoTests.m; sourceTree = ""; }; 53 | B95877AC1D53935D0011ACE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | B95877B11D53935D0011ACE9 /* TDProxyDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TDProxyDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | B95877B51D53935D0011ACE9 /* TDProxyDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TDProxyDemoUITests.m; sourceTree = ""; }; 56 | B95877B71D53935D0011ACE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | B95877C31D53A0410011ACE9 /* TDDealerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TDDealerProxy.h; sourceTree = ""; }; 58 | B95877C41D53A0410011ACE9 /* TDDealerProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TDDealerProxy.m; sourceTree = ""; }; 59 | B95877D21D54FF180011ACE9 /* TDBookProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TDBookProvider.h; sourceTree = ""; }; 60 | B95877D31D54FF180011ACE9 /* TDBookProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TDBookProvider.m; sourceTree = ""; }; 61 | B95877D51D54FF7E0011ACE9 /* TDClothesProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TDClothesProvider.h; sourceTree = ""; }; 62 | B95877D61D54FF7E0011ACE9 /* TDClothesProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TDClothesProvider.m; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | B958778A1D53935D0011ACE9 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | B95877A31D53935D0011ACE9 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | B95877AE1D53935D0011ACE9 /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | B95877841D53935D0011ACE9 = { 91 | isa = PBXGroup; 92 | children = ( 93 | B958778F1D53935D0011ACE9 /* TDProxyDemo */, 94 | B95877A91D53935D0011ACE9 /* TDProxyDemoTests */, 95 | B95877B41D53935D0011ACE9 /* TDProxyDemoUITests */, 96 | B958778E1D53935D0011ACE9 /* Products */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | B958778E1D53935D0011ACE9 /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | B958778D1D53935D0011ACE9 /* TDProxyDemo.app */, 104 | B95877A61D53935D0011ACE9 /* TDProxyDemoTests.xctest */, 105 | B95877B11D53935D0011ACE9 /* TDProxyDemoUITests.xctest */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | B958778F1D53935D0011ACE9 /* TDProxyDemo */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | B95877931D53935D0011ACE9 /* AppDelegate.h */, 114 | B95877941D53935D0011ACE9 /* AppDelegate.m */, 115 | B95877961D53935D0011ACE9 /* ViewController.h */, 116 | B95877971D53935D0011ACE9 /* ViewController.m */, 117 | B95877991D53935D0011ACE9 /* Main.storyboard */, 118 | B958779C1D53935D0011ACE9 /* Assets.xcassets */, 119 | B958779E1D53935D0011ACE9 /* LaunchScreen.storyboard */, 120 | B95877A11D53935D0011ACE9 /* Info.plist */, 121 | B95877901D53935D0011ACE9 /* Supporting Files */, 122 | B95877C31D53A0410011ACE9 /* TDDealerProxy.h */, 123 | B95877C41D53A0410011ACE9 /* TDDealerProxy.m */, 124 | B95877D21D54FF180011ACE9 /* TDBookProvider.h */, 125 | B95877D31D54FF180011ACE9 /* TDBookProvider.m */, 126 | B95877D51D54FF7E0011ACE9 /* TDClothesProvider.h */, 127 | B95877D61D54FF7E0011ACE9 /* TDClothesProvider.m */, 128 | ); 129 | path = TDProxyDemo; 130 | sourceTree = ""; 131 | }; 132 | B95877901D53935D0011ACE9 /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | B95877911D53935D0011ACE9 /* main.m */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | B95877A91D53935D0011ACE9 /* TDProxyDemoTests */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | B95877AA1D53935D0011ACE9 /* TDProxyDemoTests.m */, 144 | B95877AC1D53935D0011ACE9 /* Info.plist */, 145 | ); 146 | path = TDProxyDemoTests; 147 | sourceTree = ""; 148 | }; 149 | B95877B41D53935D0011ACE9 /* TDProxyDemoUITests */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | B95877B51D53935D0011ACE9 /* TDProxyDemoUITests.m */, 153 | B95877B71D53935D0011ACE9 /* Info.plist */, 154 | ); 155 | path = TDProxyDemoUITests; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | B958778C1D53935D0011ACE9 /* TDProxyDemo */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = B95877BA1D53935D0011ACE9 /* Build configuration list for PBXNativeTarget "TDProxyDemo" */; 164 | buildPhases = ( 165 | B95877891D53935D0011ACE9 /* Sources */, 166 | B958778A1D53935D0011ACE9 /* Frameworks */, 167 | B958778B1D53935D0011ACE9 /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = TDProxyDemo; 174 | productName = TDProxyDemo; 175 | productReference = B958778D1D53935D0011ACE9 /* TDProxyDemo.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | B95877A51D53935D0011ACE9 /* TDProxyDemoTests */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = B95877BD1D53935D0011ACE9 /* Build configuration list for PBXNativeTarget "TDProxyDemoTests" */; 181 | buildPhases = ( 182 | B95877A21D53935D0011ACE9 /* Sources */, 183 | B95877A31D53935D0011ACE9 /* Frameworks */, 184 | B95877A41D53935D0011ACE9 /* Resources */, 185 | ); 186 | buildRules = ( 187 | ); 188 | dependencies = ( 189 | B95877A81D53935D0011ACE9 /* PBXTargetDependency */, 190 | ); 191 | name = TDProxyDemoTests; 192 | productName = TDProxyDemoTests; 193 | productReference = B95877A61D53935D0011ACE9 /* TDProxyDemoTests.xctest */; 194 | productType = "com.apple.product-type.bundle.unit-test"; 195 | }; 196 | B95877B01D53935D0011ACE9 /* TDProxyDemoUITests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = B95877C01D53935D0011ACE9 /* Build configuration list for PBXNativeTarget "TDProxyDemoUITests" */; 199 | buildPhases = ( 200 | B95877AD1D53935D0011ACE9 /* Sources */, 201 | B95877AE1D53935D0011ACE9 /* Frameworks */, 202 | B95877AF1D53935D0011ACE9 /* Resources */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | B95877B31D53935D0011ACE9 /* PBXTargetDependency */, 208 | ); 209 | name = TDProxyDemoUITests; 210 | productName = TDProxyDemoUITests; 211 | productReference = B95877B11D53935D0011ACE9 /* TDProxyDemoUITests.xctest */; 212 | productType = "com.apple.product-type.bundle.ui-testing"; 213 | }; 214 | /* End PBXNativeTarget section */ 215 | 216 | /* Begin PBXProject section */ 217 | B95877851D53935D0011ACE9 /* Project object */ = { 218 | isa = PBXProject; 219 | attributes = { 220 | LastUpgradeCheck = 0730; 221 | ORGANIZATIONNAME = jojoting; 222 | TargetAttributes = { 223 | B958778C1D53935D0011ACE9 = { 224 | CreatedOnToolsVersion = 7.3.1; 225 | }; 226 | B95877A51D53935D0011ACE9 = { 227 | CreatedOnToolsVersion = 7.3.1; 228 | TestTargetID = B958778C1D53935D0011ACE9; 229 | }; 230 | B95877B01D53935D0011ACE9 = { 231 | CreatedOnToolsVersion = 7.3.1; 232 | TestTargetID = B958778C1D53935D0011ACE9; 233 | }; 234 | }; 235 | }; 236 | buildConfigurationList = B95877881D53935D0011ACE9 /* Build configuration list for PBXProject "TDProxyDemo" */; 237 | compatibilityVersion = "Xcode 3.2"; 238 | developmentRegion = English; 239 | hasScannedForEncodings = 0; 240 | knownRegions = ( 241 | en, 242 | Base, 243 | ); 244 | mainGroup = B95877841D53935D0011ACE9; 245 | productRefGroup = B958778E1D53935D0011ACE9 /* Products */; 246 | projectDirPath = ""; 247 | projectRoot = ""; 248 | targets = ( 249 | B958778C1D53935D0011ACE9 /* TDProxyDemo */, 250 | B95877A51D53935D0011ACE9 /* TDProxyDemoTests */, 251 | B95877B01D53935D0011ACE9 /* TDProxyDemoUITests */, 252 | ); 253 | }; 254 | /* End PBXProject section */ 255 | 256 | /* Begin PBXResourcesBuildPhase section */ 257 | B958778B1D53935D0011ACE9 /* Resources */ = { 258 | isa = PBXResourcesBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | B95877A01D53935D0011ACE9 /* LaunchScreen.storyboard in Resources */, 262 | B958779D1D53935D0011ACE9 /* Assets.xcassets in Resources */, 263 | B958779B1D53935D0011ACE9 /* Main.storyboard in Resources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | B95877A41D53935D0011ACE9 /* Resources */ = { 268 | isa = PBXResourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | B95877AF1D53935D0011ACE9 /* Resources */ = { 275 | isa = PBXResourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXResourcesBuildPhase section */ 282 | 283 | /* Begin PBXSourcesBuildPhase section */ 284 | B95877891D53935D0011ACE9 /* Sources */ = { 285 | isa = PBXSourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | B95877981D53935D0011ACE9 /* ViewController.m in Sources */, 289 | B95877C51D53A0410011ACE9 /* TDDealerProxy.m in Sources */, 290 | B95877D71D54FF7E0011ACE9 /* TDClothesProvider.m in Sources */, 291 | B95877951D53935D0011ACE9 /* AppDelegate.m in Sources */, 292 | B95877921D53935D0011ACE9 /* main.m in Sources */, 293 | B95877D41D54FF180011ACE9 /* TDBookProvider.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | B95877A21D53935D0011ACE9 /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | B95877AB1D53935D0011ACE9 /* TDProxyDemoTests.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | B95877AD1D53935D0011ACE9 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | B95877B61D53935D0011ACE9 /* TDProxyDemoUITests.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | B95877A81D53935D0011ACE9 /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = B958778C1D53935D0011ACE9 /* TDProxyDemo */; 319 | targetProxy = B95877A71D53935D0011ACE9 /* PBXContainerItemProxy */; 320 | }; 321 | B95877B31D53935D0011ACE9 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | target = B958778C1D53935D0011ACE9 /* TDProxyDemo */; 324 | targetProxy = B95877B21D53935D0011ACE9 /* PBXContainerItemProxy */; 325 | }; 326 | /* End PBXTargetDependency section */ 327 | 328 | /* Begin PBXVariantGroup section */ 329 | B95877991D53935D0011ACE9 /* Main.storyboard */ = { 330 | isa = PBXVariantGroup; 331 | children = ( 332 | B958779A1D53935D0011ACE9 /* Base */, 333 | ); 334 | name = Main.storyboard; 335 | sourceTree = ""; 336 | }; 337 | B958779E1D53935D0011ACE9 /* LaunchScreen.storyboard */ = { 338 | isa = PBXVariantGroup; 339 | children = ( 340 | B958779F1D53935D0011ACE9 /* Base */, 341 | ); 342 | name = LaunchScreen.storyboard; 343 | sourceTree = ""; 344 | }; 345 | /* End PBXVariantGroup section */ 346 | 347 | /* Begin XCBuildConfiguration section */ 348 | B95877B81D53935D0011ACE9 /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_ANALYZER_NONNULL = YES; 353 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 354 | CLANG_CXX_LIBRARY = "libc++"; 355 | CLANG_ENABLE_MODULES = YES; 356 | CLANG_ENABLE_OBJC_ARC = YES; 357 | CLANG_WARN_BOOL_CONVERSION = YES; 358 | CLANG_WARN_CONSTANT_CONVERSION = YES; 359 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 360 | CLANG_WARN_EMPTY_BODY = YES; 361 | CLANG_WARN_ENUM_CONVERSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 364 | CLANG_WARN_UNREACHABLE_CODE = YES; 365 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 366 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 367 | COPY_PHASE_STRIP = NO; 368 | DEBUG_INFORMATION_FORMAT = dwarf; 369 | ENABLE_STRICT_OBJC_MSGSEND = YES; 370 | ENABLE_TESTABILITY = YES; 371 | GCC_C_LANGUAGE_STANDARD = gnu99; 372 | GCC_DYNAMIC_NO_PIC = NO; 373 | GCC_NO_COMMON_BLOCKS = YES; 374 | GCC_OPTIMIZATION_LEVEL = 0; 375 | GCC_PREPROCESSOR_DEFINITIONS = ( 376 | "DEBUG=1", 377 | "$(inherited)", 378 | ); 379 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 380 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 381 | GCC_WARN_UNDECLARED_SELECTOR = YES; 382 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 383 | GCC_WARN_UNUSED_FUNCTION = YES; 384 | GCC_WARN_UNUSED_VARIABLE = YES; 385 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 386 | MTL_ENABLE_DEBUG_INFO = YES; 387 | ONLY_ACTIVE_ARCH = YES; 388 | SDKROOT = iphoneos; 389 | }; 390 | name = Debug; 391 | }; 392 | B95877B91D53935D0011ACE9 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_SEARCH_USER_PATHS = NO; 396 | CLANG_ANALYZER_NONNULL = YES; 397 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 398 | CLANG_CXX_LIBRARY = "libc++"; 399 | CLANG_ENABLE_MODULES = YES; 400 | CLANG_ENABLE_OBJC_ARC = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_CONSTANT_CONVERSION = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 413 | ENABLE_NS_ASSERTIONS = NO; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | GCC_C_LANGUAGE_STANDARD = gnu99; 416 | GCC_NO_COMMON_BLOCKS = YES; 417 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 418 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 419 | GCC_WARN_UNDECLARED_SELECTOR = YES; 420 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 421 | GCC_WARN_UNUSED_FUNCTION = YES; 422 | GCC_WARN_UNUSED_VARIABLE = YES; 423 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 424 | MTL_ENABLE_DEBUG_INFO = NO; 425 | SDKROOT = iphoneos; 426 | VALIDATE_PRODUCT = YES; 427 | }; 428 | name = Release; 429 | }; 430 | B95877BB1D53935D0011ACE9 /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 434 | INFOPLIST_FILE = TDProxyDemo/Info.plist; 435 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 436 | PRODUCT_BUNDLE_IDENTIFIER = jojo.TDProxyDemo; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | }; 439 | name = Debug; 440 | }; 441 | B95877BC1D53935D0011ACE9 /* Release */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | INFOPLIST_FILE = TDProxyDemo/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = jojo.TDProxyDemo; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | }; 450 | name = Release; 451 | }; 452 | B95877BE1D53935D0011ACE9 /* Debug */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | BUNDLE_LOADER = "$(TEST_HOST)"; 456 | INFOPLIST_FILE = TDProxyDemoTests/Info.plist; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = jojo.TDProxyDemoTests; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TDProxyDemo.app/TDProxyDemo"; 461 | }; 462 | name = Debug; 463 | }; 464 | B95877BF1D53935D0011ACE9 /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | BUNDLE_LOADER = "$(TEST_HOST)"; 468 | INFOPLIST_FILE = TDProxyDemoTests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = jojo.TDProxyDemoTests; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TDProxyDemo.app/TDProxyDemo"; 473 | }; 474 | name = Release; 475 | }; 476 | B95877C11D53935D0011ACE9 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | INFOPLIST_FILE = TDProxyDemoUITests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = jojo.TDProxyDemoUITests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_TARGET_NAME = TDProxyDemo; 484 | }; 485 | name = Debug; 486 | }; 487 | B95877C21D53935D0011ACE9 /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | INFOPLIST_FILE = TDProxyDemoUITests/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = jojo.TDProxyDemoUITests; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | TEST_TARGET_NAME = TDProxyDemo; 495 | }; 496 | name = Release; 497 | }; 498 | /* End XCBuildConfiguration section */ 499 | 500 | /* Begin XCConfigurationList section */ 501 | B95877881D53935D0011ACE9 /* Build configuration list for PBXProject "TDProxyDemo" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | B95877B81D53935D0011ACE9 /* Debug */, 505 | B95877B91D53935D0011ACE9 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | B95877BA1D53935D0011ACE9 /* Build configuration list for PBXNativeTarget "TDProxyDemo" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | B95877BB1D53935D0011ACE9 /* Debug */, 514 | B95877BC1D53935D0011ACE9 /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | }; 518 | B95877BD1D53935D0011ACE9 /* Build configuration list for PBXNativeTarget "TDProxyDemoTests" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | B95877BE1D53935D0011ACE9 /* Debug */, 522 | B95877BF1D53935D0011ACE9 /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | }; 526 | B95877C01D53935D0011ACE9 /* Build configuration list for PBXNativeTarget "TDProxyDemoUITests" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | B95877C11D53935D0011ACE9 /* Debug */, 530 | B95877C21D53935D0011ACE9 /* Release */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | }; 534 | /* End XCConfigurationList section */ 535 | }; 536 | rootObject = B95877851D53935D0011ACE9 /* Project object */; 537 | } 538 | -------------------------------------------------------------------------------- /TDProxyDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TDProxyDemo.xcodeproj/xcuserdata/jojoting.xcuserdatad/xcschemes/TDProxyDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /TDProxyDemo.xcodeproj/xcuserdata/jojoting.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TDProxyDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B958778C1D53935D0011ACE9 16 | 17 | primary 18 | 19 | 20 | B95877A51D53935D0011ACE9 21 | 22 | primary 23 | 24 | 25 | B95877B01D53935D0011ACE9 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TDProxyDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/4. 6 | // Copyright © 2016年 jojoting. 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 | -------------------------------------------------------------------------------- /TDProxyDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/4. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "TDDealerProxy.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | 21 | TDDealerProxy *dealerProxy = [TDDealerProxy dealerProxy]; 22 | [dealerProxy purchaseBookWithTitle:@"Swift 100 Tips"]; 23 | [dealerProxy purchaseClothesWithSize:TDClothesSizeMedium]; 24 | 25 | // Override point for customization after application launch. 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application { 30 | // 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. 31 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 32 | } 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application { 40 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application { 44 | // 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. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /TDProxyDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /TDProxyDemo/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 | 27 | 28 | -------------------------------------------------------------------------------- /TDProxyDemo/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 | -------------------------------------------------------------------------------- /TDProxyDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /TDProxyDemo/TDBookProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDBookProvider.h 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/6. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol TDBookProviderProtocol 12 | 13 | - (void)purchaseBookWithTitle:(NSString *)bookTitle; 14 | 15 | @end 16 | 17 | @interface TDBookProvider : NSObject 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TDProxyDemo/TDBookProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDBookProvider.m 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/6. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import "TDBookProvider.h" 10 | 11 | @interface TDBookProvider () 12 | 13 | @end 14 | @implementation TDBookProvider 15 | 16 | - (void)purchaseBookWithTitle:(NSString *)bookTitle{ 17 | NSLog(@"You've bought \"%@\"",bookTitle); 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /TDProxyDemo/TDClothesProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDClothesProvider.h 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/6. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM (NSInteger, TDClothesSize){ 12 | TDClothesSizeSmall = 0, 13 | TDClothesSizeMedium, 14 | TDClothesSizeLarge 15 | }; 16 | 17 | @protocol TDClothesProviderProtocol 18 | 19 | - (void)purchaseClothesWithSize:(TDClothesSize )size; 20 | 21 | @end 22 | 23 | @interface TDClothesProvider : NSObject 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /TDProxyDemo/TDClothesProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDClothesProvider.m 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/6. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import "TDClothesProvider.h" 10 | 11 | @interface TDClothesProvider () 12 | 13 | @end 14 | 15 | @implementation TDClothesProvider 16 | 17 | - (void)purchaseClothesWithSize:(TDClothesSize )size{ 18 | NSString *sizeStr; 19 | switch (size) { 20 | case TDClothesSizeLarge: 21 | sizeStr = @"large size"; 22 | break; 23 | case TDClothesSizeMedium: 24 | sizeStr = @"medium size"; 25 | break; 26 | case TDClothesSizeSmall: 27 | sizeStr = @"small size"; 28 | break; 29 | default: 30 | break; 31 | } 32 | NSLog(@"You've bought some clothes of %@",sizeStr); 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /TDProxyDemo/TDDealerProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDDealerProxy.h 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/5. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TDBookProvider.h" 11 | #import "TDClothesProvider.h" 12 | 13 | @interface TDDealerProxy : NSProxy 14 | 15 | + (instancetype)dealerProxy; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /TDProxyDemo/TDDealerProxy.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDDealerProxy.m 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/5. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import "TDDealerProxy.h" 10 | #import 11 | 12 | @interface TDDealerProxy () { 13 | TDBookProvider *_bookProvider; 14 | TDClothesProvider *_clothesProvider; 15 | NSMutableDictionary *_methodsMap; 16 | } 17 | @end 18 | 19 | @implementation TDDealerProxy 20 | 21 | #pragma mark - class method 22 | + (instancetype)dealerProxy{ 23 | return [[TDDealerProxy alloc] init]; 24 | } 25 | #pragma mark - init 26 | 27 | - (instancetype)init{ 28 | _methodsMap = [NSMutableDictionary dictionary]; 29 | _bookProvider = [[TDBookProvider alloc] init]; 30 | _clothesProvider = [[TDClothesProvider alloc] init]; 31 | [self _registerMethodsWithTarget:_bookProvider]; 32 | [self _registerMethodsWithTarget:_clothesProvider]; 33 | return self; 34 | } 35 | 36 | #pragma mark - private method 37 | - (void)_registerMethodsWithTarget:(id )target{ 38 | 39 | unsigned int numberOfMethods = 0; 40 | 41 | //获取target方法列表 42 | Method *method_list = class_copyMethodList([target class], &numberOfMethods); 43 | 44 | for (int i = 0; i < numberOfMethods; i ++) { 45 | //获取方法名并存入字典 46 | Method temp_method = method_list[i]; 47 | SEL temp_sel = method_getName(temp_method); 48 | const char *temp_method_name = sel_getName(temp_sel); 49 | [_methodsMap setObject:target forKey:[NSString stringWithUTF8String:temp_method_name]]; 50 | } 51 | 52 | free(method_list); 53 | } 54 | #pragma mark - NSProxy override methods 55 | 56 | - (void)forwardInvocation:(NSInvocation *)invocation{ 57 | //获取当前选择子 58 | SEL sel = invocation.selector; 59 | 60 | //获取选择子方法名 61 | NSString *methodName = NSStringFromSelector(sel); 62 | 63 | //在字典中查找对应的target 64 | id target = _methodsMap[methodName]; 65 | 66 | //检查target 67 | if (target && [target respondsToSelector:sel]) { 68 | [invocation invokeWithTarget:target]; 69 | } else { 70 | [super forwardInvocation:invocation]; 71 | } 72 | } 73 | 74 | 75 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel{ 76 | //获取选择子方法名 77 | NSString *methodName = NSStringFromSelector(sel); 78 | 79 | //在字典中查找对应的target 80 | id target = _methodsMap[methodName]; 81 | 82 | //检查target 83 | if (target && [target respondsToSelector:sel]) { 84 | return [target methodSignatureForSelector:sel]; 85 | } else { 86 | return [super methodSignatureForSelector:sel]; 87 | } 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /TDProxyDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/4. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /TDProxyDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/4. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /TDProxyDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TDProxyDemo 4 | // 5 | // Created by jojoting on 16/8/4. 6 | // Copyright © 2016年 jojoting. 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 | -------------------------------------------------------------------------------- /TDProxyDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /TDProxyDemoTests/TDProxyDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDProxyDemoTests.m 3 | // TDProxyDemoTests 4 | // 5 | // Created by jojoting on 16/8/4. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TDProxyDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TDProxyDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /TDProxyDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /TDProxyDemoUITests/TDProxyDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDProxyDemoUITests.m 3 | // TDProxyDemoUITests 4 | // 5 | // Created by jojoting on 16/8/4. 6 | // Copyright © 2016年 jojoting. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TDProxyDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TDProxyDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // 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. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------