├── .gitignore ├── .travis.yml ├── LICENSE ├── OCExample ├── Podfile ├── ProtocolServiceKit_Demo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── ProtocolServiceKit_Demo.xcworkspace │ └── contents.xcworkspacedata └── ProtocolServiceKit_Demo │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── LFLAppDelegate.h │ ├── LFLAppDelegate.m │ ├── LFLViewController.h │ ├── LFLViewController.m │ ├── ProtocolServiceKit_Demo-Info.plist │ ├── main.m │ └── unRules │ ├── LFLTestRuleIMP.h │ ├── LFLTestRuleIMP.m │ └── LFLUnRuleProtocol.h ├── ProtocolServiceKit.podspec ├── ProtocolServiceKit ├── Core │ ├── ProService.h │ └── ProService.m ├── ProtocolServiceKit.h └── Swift │ └── ProtocolService.swift ├── README.md └── SwiftExample ├── Podfile ├── SwiftExample.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── SwiftExample.xcworkspace └── contents.xcworkspacedata └── SwiftExample ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── Map ├── MapExampleProtocol.swift └── MapUnRuleClass.swift ├── Normal ├── SwiftNormalProtocol.swift └── SwiftNormalService.swift └── ViewController.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | xcuserdata/ 4 | xcshareddata/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata/ 14 | *.xccheckout 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | 19 | # Bundler 20 | .bundle 21 | 22 | Pods/ 23 | Podfile.lock 24 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode12.3 3 | 4 | env: 5 | global: 6 | - LC_CTYPE=en_US.UTF-8 7 | - LANG=en_US.UTF-8 8 | 9 | addons: 10 | ssh_known_hosts: github.com 11 | 12 | notifications: 13 | email: false 14 | 15 | before_install: 16 | - env 17 | - locale 18 | - gem install cocoapods --no-document --quiet 19 | - gem install xcpretty --no-document --quiet 20 | - pod --version 21 | - pod repo update --silent 22 | - xcpretty --version 23 | - xcodebuild -version 24 | - xcodebuild -showsdks 25 | 26 | script: 27 | 28 | - set -o pipefail 29 | 30 | - echo Check if the library described by the podspec can be built 31 | - pod lib lint --allow-warnings 32 | 33 | # - echo Build SwiftExample 34 | # - pod install --project-directory=SwiftExample 35 | # - xcodebuild build -workspace SwiftExample/SwiftExample.xcworkspace -scheme SwiftExample -destination 'platform=iOS Simulator,name=iPhone X' -configuration Debug | xcpretty -c 36 | - echo Build OCExample 37 | - pod install --project-directory=OCExample 38 | - xcodebuild build -workspace OCExample/ProtocolServiceKit_Demo.xcworkspace -scheme ProtocolServiceKit_Demo_Example -destination 'platform=iOS Simulator,name=iPhone X' -configuration Debug | xcpretty -c 39 | 40 | - echo Clean DerivedData 41 | - rm -rf ~/Library/Developer/Xcode/DerivedData/ 42 | - mkdir DerivedData 43 | 44 | #- echo Run the tests 45 | #- xcodebuild test -workspace Example/ProtocolServiceManger.xcworkspace -scheme 'ProtocolServiceManger_Tests' -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug | xcpretty -c 46 | #- mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 龙 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OCExample/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://cdn.cocoapods.org' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'ProtocolServiceKit_Demo_Example' do 7 | 8 | puts "make sure you can open GitHub website!" 9 | 10 | pod 'ProtocolServiceKit', :path => '../' 11 | 12 | pod 'AccountBusiness',:git => "https://github.com/Todaycoding/ProtocolServiceKit-AccountMoudle.git" 13 | 14 | pod 'PlayBusiness',:git => "https://github.com/Todaycoding/ProtocolServiceKit-PlayMoudle.git" 15 | 16 | end 17 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 20B744E55C9BDD038FE73C1B /* Pods_ProtocolServiceKit_Demo_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EFD93239DCD852172F2A14F /* Pods_ProtocolServiceKit_Demo_Example.framework */; }; 11 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 12 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 13 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 14 | DE49691125FB49E5008A9124 /* LFLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DE49690325FB49E5008A9124 /* LFLAppDelegate.m */; }; 15 | DE49691225FB49E5008A9124 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DE49690425FB49E5008A9124 /* LaunchScreen.storyboard */; }; 16 | DE49691325FB49E5008A9124 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DE49690625FB49E5008A9124 /* Main.storyboard */; }; 17 | DE49691425FB49E5008A9124 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DE49690825FB49E5008A9124 /* main.m */; }; 18 | DE49691525FB49E5008A9124 /* LFLTestRuleIMP.m in Sources */ = {isa = PBXBuildFile; fileRef = DE49690C25FB49E5008A9124 /* LFLTestRuleIMP.m */; }; 19 | DE49691725FB49E5008A9124 /* LFLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DE49690E25FB49E5008A9124 /* LFLViewController.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 5C05A3EC32CBE423C661E65C /* Pods-ProtocolServiceManger_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ProtocolServiceManger_Example.release.xcconfig"; path = "Target Support Files/Pods-ProtocolServiceManger_Example/Pods-ProtocolServiceManger_Example.release.xcconfig"; sourceTree = ""; }; 24 | 6003F58A195388D20070C39A /* ProtocolServiceKit_Demo_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ProtocolServiceKit_Demo_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 27 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 29 | 68A4B015DF2164185E497A0B /* Pods-ProtocolServiceManger_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ProtocolServiceManger_Tests.debug.xcconfig"; path = "Target Support Files/Pods-ProtocolServiceManger_Tests/Pods-ProtocolServiceManger_Tests.debug.xcconfig"; sourceTree = ""; }; 30 | 8EFD93239DCD852172F2A14F /* Pods_ProtocolServiceKit_Demo_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ProtocolServiceKit_Demo_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 969E6221237BC1DF96D5B4A3 /* Pods-ProtocolServiceManger_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ProtocolServiceManger_Tests.release.xcconfig"; path = "Target Support Files/Pods-ProtocolServiceManger_Tests/Pods-ProtocolServiceManger_Tests.release.xcconfig"; sourceTree = ""; }; 32 | B0397627BED2210B53DF29B8 /* Pods-ProtocolServiceKit_Demo_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ProtocolServiceKit_Demo_Example.debug.xcconfig"; path = "Target Support Files/Pods-ProtocolServiceKit_Demo_Example/Pods-ProtocolServiceKit_Demo_Example.debug.xcconfig"; sourceTree = ""; }; 33 | BBA7374AE9D8FCBF2B2A86BD /* Pods_ProtocolServiceManger_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ProtocolServiceManger_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | C05945134C188D0495A62A59 /* Pods-ProtocolServiceManger_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ProtocolServiceManger_Example.debug.xcconfig"; path = "Target Support Files/Pods-ProtocolServiceManger_Example/Pods-ProtocolServiceManger_Example.debug.xcconfig"; sourceTree = ""; }; 35 | DAE34199E1739C6E372A7A71 /* Pods-ProtocolServiceKit_Demo_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ProtocolServiceKit_Demo_Example.release.xcconfig"; path = "Target Support Files/Pods-ProtocolServiceKit_Demo_Example/Pods-ProtocolServiceKit_Demo_Example.release.xcconfig"; sourceTree = ""; }; 36 | DE49690225FB49E5008A9124 /* LFLViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFLViewController.h; sourceTree = ""; }; 37 | DE49690325FB49E5008A9124 /* LFLAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LFLAppDelegate.m; sourceTree = ""; }; 38 | DE49690525FB49E5008A9124 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 39 | DE49690725FB49E5008A9124 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | DE49690825FB49E5008A9124 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | DE49690A25FB49E5008A9124 /* LFLTestRuleIMP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFLTestRuleIMP.h; sourceTree = ""; }; 42 | DE49690B25FB49E5008A9124 /* LFLUnRuleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFLUnRuleProtocol.h; sourceTree = ""; }; 43 | DE49690C25FB49E5008A9124 /* LFLTestRuleIMP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LFLTestRuleIMP.m; sourceTree = ""; }; 44 | DE49690E25FB49E5008A9124 /* LFLViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LFLViewController.m; sourceTree = ""; }; 45 | DE49690F25FB49E5008A9124 /* ProtocolServiceKit_Demo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ProtocolServiceKit_Demo-Info.plist"; sourceTree = ""; }; 46 | DE49691025FB49E5008A9124 /* LFLAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFLAppDelegate.h; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 6003F587195388D20070C39A /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 55 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 56 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 57 | 20B744E55C9BDD038FE73C1B /* Pods_ProtocolServiceKit_Demo_Example.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 4C1BDE9CC72EA4149DEDB77F /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | C05945134C188D0495A62A59 /* Pods-ProtocolServiceManger_Example.debug.xcconfig */, 68 | 5C05A3EC32CBE423C661E65C /* Pods-ProtocolServiceManger_Example.release.xcconfig */, 69 | 68A4B015DF2164185E497A0B /* Pods-ProtocolServiceManger_Tests.debug.xcconfig */, 70 | 969E6221237BC1DF96D5B4A3 /* Pods-ProtocolServiceManger_Tests.release.xcconfig */, 71 | B0397627BED2210B53DF29B8 /* Pods-ProtocolServiceKit_Demo_Example.debug.xcconfig */, 72 | DAE34199E1739C6E372A7A71 /* Pods-ProtocolServiceKit_Demo_Example.release.xcconfig */, 73 | ); 74 | path = Pods; 75 | sourceTree = ""; 76 | }; 77 | 6003F581195388D10070C39A = { 78 | isa = PBXGroup; 79 | children = ( 80 | DE49690125FB49E5008A9124 /* ProtocolServiceKit_Demo */, 81 | 6003F58C195388D20070C39A /* Frameworks */, 82 | 6003F58B195388D20070C39A /* Products */, 83 | 4C1BDE9CC72EA4149DEDB77F /* Pods */, 84 | ); 85 | sourceTree = ""; 86 | }; 87 | 6003F58B195388D20070C39A /* Products */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 6003F58A195388D20070C39A /* ProtocolServiceKit_Demo_Example.app */, 91 | ); 92 | name = Products; 93 | sourceTree = ""; 94 | }; 95 | 6003F58C195388D20070C39A /* Frameworks */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 6003F58D195388D20070C39A /* Foundation.framework */, 99 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 100 | 6003F591195388D20070C39A /* UIKit.framework */, 101 | 6003F5AF195388D20070C39A /* XCTest.framework */, 102 | BBA7374AE9D8FCBF2B2A86BD /* Pods_ProtocolServiceManger_Tests.framework */, 103 | 8EFD93239DCD852172F2A14F /* Pods_ProtocolServiceKit_Demo_Example.framework */, 104 | ); 105 | name = Frameworks; 106 | sourceTree = ""; 107 | }; 108 | DE49690125FB49E5008A9124 /* ProtocolServiceKit_Demo */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | DE49690925FB49E5008A9124 /* unRules */, 112 | DE49691025FB49E5008A9124 /* LFLAppDelegate.h */, 113 | DE49690325FB49E5008A9124 /* LFLAppDelegate.m */, 114 | DE49690225FB49E5008A9124 /* LFLViewController.h */, 115 | DE49690E25FB49E5008A9124 /* LFLViewController.m */, 116 | DE49690425FB49E5008A9124 /* LaunchScreen.storyboard */, 117 | DE49690625FB49E5008A9124 /* Main.storyboard */, 118 | DE49690825FB49E5008A9124 /* main.m */, 119 | DE49690F25FB49E5008A9124 /* ProtocolServiceKit_Demo-Info.plist */, 120 | ); 121 | path = ProtocolServiceKit_Demo; 122 | sourceTree = SOURCE_ROOT; 123 | }; 124 | DE49690925FB49E5008A9124 /* unRules */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | DE49690B25FB49E5008A9124 /* LFLUnRuleProtocol.h */, 128 | DE49690A25FB49E5008A9124 /* LFLTestRuleIMP.h */, 129 | DE49690C25FB49E5008A9124 /* LFLTestRuleIMP.m */, 130 | ); 131 | path = unRules; 132 | sourceTree = ""; 133 | }; 134 | /* End PBXGroup section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | 6003F589195388D20070C39A /* ProtocolServiceKit_Demo_Example */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "ProtocolServiceKit_Demo_Example" */; 140 | buildPhases = ( 141 | 7B800AC44583FA6B7540E16D /* [CP] Check Pods Manifest.lock */, 142 | 6003F586195388D20070C39A /* Sources */, 143 | 6003F587195388D20070C39A /* Frameworks */, 144 | 6003F588195388D20070C39A /* Resources */, 145 | AEF6AFFFF18EC9888B0BA4A5 /* [CP] Embed Pods Frameworks */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | ); 151 | name = ProtocolServiceKit_Demo_Example; 152 | productName = ProtocolServiceManger; 153 | productReference = 6003F58A195388D20070C39A /* ProtocolServiceKit_Demo_Example.app */; 154 | productType = "com.apple.product-type.application"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | 6003F582195388D10070C39A /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | CLASSPREFIX = LFL; 163 | LastUpgradeCheck = 1150; 164 | ORGANIZATIONNAME = DevdragonLi; 165 | }; 166 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "ProtocolServiceKit_Demo" */; 167 | compatibilityVersion = "Xcode 3.2"; 168 | developmentRegion = en; 169 | hasScannedForEncodings = 0; 170 | knownRegions = ( 171 | Base, 172 | en, 173 | ); 174 | mainGroup = 6003F581195388D10070C39A; 175 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 176 | projectDirPath = ""; 177 | projectRoot = ""; 178 | targets = ( 179 | 6003F589195388D20070C39A /* ProtocolServiceKit_Demo_Example */, 180 | ); 181 | }; 182 | /* End PBXProject section */ 183 | 184 | /* Begin PBXResourcesBuildPhase section */ 185 | 6003F588195388D20070C39A /* Resources */ = { 186 | isa = PBXResourcesBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | DE49691225FB49E5008A9124 /* LaunchScreen.storyboard in Resources */, 190 | DE49691325FB49E5008A9124 /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 7B800AC44583FA6B7540E16D /* [CP] Check Pods Manifest.lock */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputFileListPaths = ( 203 | ); 204 | inputPaths = ( 205 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 206 | "${PODS_ROOT}/Manifest.lock", 207 | ); 208 | name = "[CP] Check Pods Manifest.lock"; 209 | outputFileListPaths = ( 210 | ); 211 | outputPaths = ( 212 | "$(DERIVED_FILE_DIR)/Pods-ProtocolServiceKit_Demo_Example-checkManifestLockResult.txt", 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | shellPath = /bin/sh; 216 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 217 | showEnvVarsInLog = 0; 218 | }; 219 | AEF6AFFFF18EC9888B0BA4A5 /* [CP] Embed Pods Frameworks */ = { 220 | isa = PBXShellScriptBuildPhase; 221 | buildActionMask = 2147483647; 222 | files = ( 223 | ); 224 | inputPaths = ( 225 | "${PODS_ROOT}/Target Support Files/Pods-ProtocolServiceKit_Demo_Example/Pods-ProtocolServiceKit_Demo_Example-frameworks.sh", 226 | "${BUILT_PRODUCTS_DIR}/AccountBusiness/AccountBusiness.framework", 227 | "${BUILT_PRODUCTS_DIR}/PlayBusiness/PlayBusiness.framework", 228 | "${BUILT_PRODUCTS_DIR}/ProtocolServiceKit/ProtocolServiceKit.framework", 229 | ); 230 | name = "[CP] Embed Pods Frameworks"; 231 | outputPaths = ( 232 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AccountBusiness.framework", 233 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PlayBusiness.framework", 234 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ProtocolServiceKit.framework", 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | shellPath = /bin/sh; 238 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ProtocolServiceKit_Demo_Example/Pods-ProtocolServiceKit_Demo_Example-frameworks.sh\"\n"; 239 | showEnvVarsInLog = 0; 240 | }; 241 | /* End PBXShellScriptBuildPhase section */ 242 | 243 | /* Begin PBXSourcesBuildPhase section */ 244 | 6003F586195388D20070C39A /* Sources */ = { 245 | isa = PBXSourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | DE49691525FB49E5008A9124 /* LFLTestRuleIMP.m in Sources */, 249 | DE49691425FB49E5008A9124 /* main.m in Sources */, 250 | DE49691125FB49E5008A9124 /* LFLAppDelegate.m in Sources */, 251 | DE49691725FB49E5008A9124 /* LFLViewController.m in Sources */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | /* End PBXSourcesBuildPhase section */ 256 | 257 | /* Begin PBXVariantGroup section */ 258 | DE49690425FB49E5008A9124 /* LaunchScreen.storyboard */ = { 259 | isa = PBXVariantGroup; 260 | children = ( 261 | DE49690525FB49E5008A9124 /* Base */, 262 | ); 263 | name = LaunchScreen.storyboard; 264 | sourceTree = ""; 265 | }; 266 | DE49690625FB49E5008A9124 /* Main.storyboard */ = { 267 | isa = PBXVariantGroup; 268 | children = ( 269 | DE49690725FB49E5008A9124 /* Base */, 270 | ); 271 | name = Main.storyboard; 272 | sourceTree = ""; 273 | }; 274 | /* End PBXVariantGroup section */ 275 | 276 | /* Begin XCBuildConfiguration section */ 277 | 6003F5BD195388D20070C39A /* Debug */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ALWAYS_SEARCH_USER_PATHS = NO; 281 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 282 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 283 | CLANG_CXX_LIBRARY = "libc++"; 284 | CLANG_ENABLE_MODULES = YES; 285 | CLANG_ENABLE_OBJC_ARC = YES; 286 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 287 | CLANG_WARN_BOOL_CONVERSION = YES; 288 | CLANG_WARN_COMMA = YES; 289 | CLANG_WARN_CONSTANT_CONVERSION = YES; 290 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 291 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 292 | CLANG_WARN_EMPTY_BODY = YES; 293 | CLANG_WARN_ENUM_CONVERSION = YES; 294 | CLANG_WARN_INFINITE_RECURSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 297 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 298 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 299 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 300 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 301 | CLANG_WARN_STRICT_PROTOTYPES = YES; 302 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 306 | COPY_PHASE_STRIP = NO; 307 | ENABLE_STRICT_OBJC_MSGSEND = YES; 308 | ENABLE_TESTABILITY = YES; 309 | GCC_C_LANGUAGE_STANDARD = gnu99; 310 | GCC_DYNAMIC_NO_PIC = NO; 311 | GCC_NO_COMMON_BLOCKS = YES; 312 | GCC_OPTIMIZATION_LEVEL = 0; 313 | GCC_PREPROCESSOR_DEFINITIONS = ( 314 | "DEBUG=1", 315 | "$(inherited)", 316 | ); 317 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 320 | GCC_WARN_UNDECLARED_SELECTOR = YES; 321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 322 | GCC_WARN_UNUSED_FUNCTION = YES; 323 | GCC_WARN_UNUSED_VARIABLE = YES; 324 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 325 | ONLY_ACTIVE_ARCH = YES; 326 | SDKROOT = iphoneos; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | }; 329 | name = Debug; 330 | }; 331 | 6003F5BE195388D20070C39A /* Release */ = { 332 | isa = XCBuildConfiguration; 333 | buildSettings = { 334 | ALWAYS_SEARCH_USER_PATHS = NO; 335 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 336 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 337 | CLANG_CXX_LIBRARY = "libc++"; 338 | CLANG_ENABLE_MODULES = YES; 339 | CLANG_ENABLE_OBJC_ARC = YES; 340 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 341 | CLANG_WARN_BOOL_CONVERSION = YES; 342 | CLANG_WARN_COMMA = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INFINITE_RECURSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = YES; 361 | ENABLE_NS_ASSERTIONS = NO; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | GCC_C_LANGUAGE_STANDARD = gnu99; 364 | GCC_NO_COMMON_BLOCKS = YES; 365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 367 | GCC_WARN_UNDECLARED_SELECTOR = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 369 | GCC_WARN_UNUSED_FUNCTION = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 372 | SDKROOT = iphoneos; 373 | TARGETED_DEVICE_FAMILY = "1,2"; 374 | VALIDATE_PRODUCT = YES; 375 | }; 376 | name = Release; 377 | }; 378 | 6003F5C0195388D20070C39A /* Debug */ = { 379 | isa = XCBuildConfiguration; 380 | baseConfigurationReference = B0397627BED2210B53DF29B8 /* Pods-ProtocolServiceKit_Demo_Example.debug.xcconfig */; 381 | buildSettings = { 382 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 383 | DEVELOPMENT_TEAM = ""; 384 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 385 | GCC_PREFIX_HEADER = ""; 386 | INFOPLIST_FILE = "ProtocolServiceKit_Demo/ProtocolServiceKit_Demo-Info.plist"; 387 | MODULE_NAME = ExampleApp; 388 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.demo.ProtocolServiceKit; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | SWIFT_VERSION = 4.0; 391 | WRAPPER_EXTENSION = app; 392 | }; 393 | name = Debug; 394 | }; 395 | 6003F5C1195388D20070C39A /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | baseConfigurationReference = DAE34199E1739C6E372A7A71 /* Pods-ProtocolServiceKit_Demo_Example.release.xcconfig */; 398 | buildSettings = { 399 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 400 | DEVELOPMENT_TEAM = FNCPC67LST; 401 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 402 | GCC_PREFIX_HEADER = ""; 403 | INFOPLIST_FILE = "ProtocolServiceKit_Demo/ProtocolServiceKit_Demo-Info.plist"; 404 | MODULE_NAME = ExampleApp; 405 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.demo.ProtocolServiceKit; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | SWIFT_VERSION = 4.0; 408 | WRAPPER_EXTENSION = app; 409 | }; 410 | name = Release; 411 | }; 412 | /* End XCBuildConfiguration section */ 413 | 414 | /* Begin XCConfigurationList section */ 415 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "ProtocolServiceKit_Demo" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | 6003F5BD195388D20070C39A /* Debug */, 419 | 6003F5BE195388D20070C39A /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "ProtocolServiceKit_Demo_Example" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | 6003F5C0195388D20070C39A /* Debug */, 428 | 6003F5C1195388D20070C39A /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | /* End XCConfigurationList section */ 434 | }; 435 | rootObject = 6003F582195388D10070C39A /* Project object */; 436 | } 437 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/LFLAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFLAppDelegate.h 3 | // ProtocolServiceKit_Demo 4 | // 5 | // Created by DevdragonLi on 07/18/2020. 6 | // Copyright (c) 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface LFLAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/LFLAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LFLAppDelegate.m 3 | // ProtocolServiceKit_Demo 4 | // 5 | // Created by DevdragonLi on 07/18/2020. 6 | // Copyright (c) 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | #import "LFLAppDelegate.h" 10 | #import 11 | 12 | @implementation LFLAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 15 | 16 | [self configServiceMaps]; 17 | 18 | return YES; 19 | } 20 | 21 | - (void)configServiceMaps { 22 | 23 | NSDictionary *mapDic = @{ 24 | @"LFLUnRuleProtocol":@"LFLTestRuleIMP" 25 | }; 26 | //recommend : 项目Map较多,可plist文件维护【避免代码硬编码类出错】! 27 | [[ProService sharedManger] configProtocolServiceMapsWithDic:mapDic]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/LFLViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFLViewController.h 3 | // ProtocolServiceKit_Demo 4 | // 5 | // Created by DevdragonLi on 07/18/2020. 6 | // Copyright (c) 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface LFLViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/LFLViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LFLViewController.m 3 | // ProtocolServiceKit_Demo 4 | // 5 | // Created by DevdragonLi on 07/18/2020. 6 | // Copyright (c) 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | /** 10 | #import Compiler error [组件仅仅对外API 层可访问] 11 | */ 12 | 13 | #import "LFLViewController.h" 14 | #import 15 | 16 | #import 17 | #import 18 | 19 | #import "LFLUnRuleProtocol.h" 20 | 21 | @interface LFLViewController () 22 | 23 | @end 24 | 25 | @implementation LFLViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | [self normalExample]; 30 | } 31 | 32 | /// Map =》 LFLAppDelegate.m 33 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 34 | 35 | // 此处Class 实际为LFLTestRuleIMP 36 | Class ruleService = ServiceWithProtocol(LFLUnRuleProtocol); 37 | // 类函数 38 | [ruleService unRuleMethod]; 39 | 40 | // 对象函数 :代码提醒 41 | // [[ruleService shared] arrayValue:@[].copy]; 42 | // [[ruleService shared] dicValue:@{}.copy]; 43 | 44 | } 45 | 46 | /// normalExample 47 | - (void)normalExample { 48 | 49 | // VIP和播放业务复杂后,只公开Protocol文件决定业务对外能力 50 | Class vipService = ServiceWithProtocol(LFLVipProtocol); 51 | 52 | // 不直接使用对应账户类 [LFLAccountTool isUserVipStatus]; 53 | BOOL isVip = [vipService isCurrentUserVipStatus]; 54 | 55 | if (vipService && isVip) { 56 | // ServiceWithCachedProtocol:缓存API 57 | [ServiceWithCachedProtocol(LFLPlayProtocol) playMiniVideo]; 58 | } else { 59 | NSLog(@"Error:LFLVipProtocol not Found service Class"); 60 | } 61 | 62 | if (vipService && [vipService isCurrentUserVipStatus]) { 63 | [ServiceWithCachedProtocol(LFLPlayProtocol) playMiniVideo]; 64 | } else { 65 | NSLog(@"Error:LFLVipProtocol not Found service Class"); 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/ProtocolServiceKit_Demo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ProtocolServiceKit_Demo 4 | // 5 | // Created by DevdragonLi on 07/18/2020. 6 | // Copyright (c) 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "LFLAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([LFLAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/unRules/LFLTestRuleIMP.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFLTestRuleIMP.h 3 | // ProtocolServiceKit_Demo_Example 4 | // 5 | // Created by admin on 19/8/2020. 6 | // Copyright © 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// Example:当前协议实现类 <=>并非LFLUnRuleService 14 | 15 | @interface LFLTestRuleIMP : NSObject 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/unRules/LFLTestRuleIMP.m: -------------------------------------------------------------------------------- 1 | // 2 | // LFLTestRuleIMP.m 3 | // ProtocolServiceKit_Demo_Example 4 | // 5 | // Created by admin on 19/8/2020. 6 | // Copyright © 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | #import "LFLTestRuleIMP.h" 10 | 11 | #import "LFLUnRuleProtocol.h" 12 | 13 | @interface LFLTestRuleIMP () 14 | 15 | @end 16 | 17 | @implementation LFLTestRuleIMP 18 | 19 | 20 | + (void)unRuleMethod { 21 | NSLog(@"协议:%@,实际服务类名%@",NSStringFromProtocol(@protocol(LFLUnRuleProtocol)),NSStringFromClass([self class])); 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /OCExample/ProtocolServiceKit_Demo/unRules/LFLUnRuleProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFLUnRuleProtocol.h 3 | // ProtocolServiceKit_Demo_Example 4 | // 5 | // Created by admin on 19/8/2020. 6 | // Copyright © 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol LFLUnRuleProtocol 14 | 15 | + (void)unRuleMethod; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /ProtocolServiceKit.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = 'ProtocolServiceKit' 4 | 5 | s.version = '2.2.2' 6 | 7 | s.summary = 'ProtocolServiceKit:The most efficient and concise iOS Component Middleware' 8 | 9 | s.description = <<-DESC 10 | 11 | 东半球最高效简洁的iOS组件中间件,支持Cache,Map机制。 12 | 支持ObjC/Swift。 13 | DESC 14 | 15 | s.homepage = 'https://github.com/DevdragonLi/ProtocolServiceKit' 16 | 17 | s.license = { :type => 'MIT', :file => 'LICENSE' } 18 | 19 | s.author = { 'DevdragonLi' => 'dragonLi_52171@163.com' } 20 | 21 | s.source = { :git => 'https://github.com/DevdragonLi/ProtocolServiceKit.git', :tag => s.version.to_s } 22 | 23 | s.ios.deployment_target = '10.0' 24 | 25 | s.swift_version = '5.0' 26 | 27 | s.default_subspec = 'ObjC' 28 | 29 | s.subspec 'Swift' do |ss| 30 | 31 | ss.source_files = 'ProtocolServiceKit/**/*.{h,m,swift}' 32 | 33 | end 34 | 35 | s.subspec 'ObjC' do |ss| 36 | 37 | ss.source_files = 'ProtocolServiceKit/**/*.{h,m}' 38 | 39 | ss.public_header_files = 'ProtocolServiceKit/ProtocolServiceKit.h', 40 | 'ProtocolServiceKit/Core/*.h' 41 | end 42 | 43 | end 44 | -------------------------------------------------------------------------------- /ProtocolServiceKit/Core/ProService.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProService.h 3 | // ProService 4 | // 5 | // Created by DevDragonli on 18/7/2020. 6 | // 7 | 8 | #import 9 | 10 | /// Recommend:cache Service Class 11 | #define ServiceWithCachedProtocol(cachedProtocol) [[ProService sharedManger] serviceClassWithCachedProtocol:@protocol(cachedProtocol)] 12 | 13 | /// Uncache Service Class 14 | #define ServiceWithProtocol(aProtocol) [[ProService sharedManger] serviceClassWithProtocol:@protocol(aProtocol)] 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface ProService : NSObject 19 | 20 | /// Default Value NO 【setting YES,ignore All Error Type 】 21 | @property (nonatomic,assign)BOOL ignoreSafeMode; 22 | 23 | + (instancetype)sharedManger; 24 | 25 | /// Efficient Protocol <=> Service Class 26 | /// Find Service Class Priority:1.NameRules 2.Map Rules 27 | /// @param aProtocol aProtocol 28 | - (Class)serviceClassWithProtocol:(Protocol *)aProtocol; 29 | 30 | /// efficient Transfer aProtocol to Service Class 31 | /// NOTE:only Recommend user in Core Module ! 32 | /// Find Service Class Priority:1. Cache Service Class 2.NameRules 3.Map Rules 33 | /// @param cachedProtocol aProtocol 34 | - (Class)serviceClassWithCachedProtocol:(Protocol *)cachedProtocol; 35 | 36 | /// config Protocol && ServiceClass MapDics 37 | /// @param mapDics Map < Key:protocolStringKey Value:serviceClassString > 38 | /// NOTE: main Thread run【make sure any map Service can Return Frist】 39 | - (void)configProtocolServiceMapsWithDic:(NSDictionary < NSString * ,NSString *> *)mapDics; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /ProtocolServiceKit/Core/ProService.m: -------------------------------------------------------------------------------- 1 | // 2 | // ProService.m 3 | // ProService 4 | // 5 | // Created by DevDragonli on 18/7/2020. 6 | // 7 | 8 | #import "ProService.h" 9 | 10 | static NSString *const ProServiceProtocolStringID = @"Protocol"; 11 | 12 | static NSString *const ProServiceClassStringID = @"Service"; 13 | 14 | @interface ProService () 15 | 16 | /// Map < Key:protocolKey Value:serviceClassString > 17 | @property (nonatomic,strong,nullable) NSMutableDictionary < NSString *, NSString * > * mapDics; 18 | 19 | /// cache < Value:serviceClass = Key:protocol > 20 | @property (nonatomic,strong,nullable) NSMutableDictionary * cacheDics; 21 | 22 | @end 23 | 24 | @implementation ProService 25 | 26 | + (instancetype)sharedManger { 27 | static dispatch_once_t once; 28 | static ProService *sharedManger; 29 | dispatch_once(&once, ^{ 30 | sharedManger = [[[self class] alloc] init]; 31 | }); 32 | return sharedManger; 33 | } 34 | 35 | - (Class)serviceClassWithProtocol:(Protocol *)aProtocol { 36 | return [self serviceClassWithProtocol:aProtocol isCache:NO]; 37 | } 38 | 39 | #pragma mark - cache serviceClass Method 40 | 41 | - (Class)serviceClassWithCachedProtocol:(Protocol *)cachedProtocol { 42 | // frist try cacheServiceClass 43 | Class cacheServiceClass = [self.cacheDics objectForKey:NSStringFromProtocol(cachedProtocol)]; 44 | if (cacheServiceClass) { 45 | // if cahched Service,can return 46 | return cacheServiceClass; 47 | } else { 48 | return [self serviceClassWithProtocol:cachedProtocol isCache:YES]; 49 | } 50 | } 51 | 52 | - (Class)serviceClassWithProtocol:(Protocol *)aProtocol 53 | isCache:(BOOL)isCache { 54 | // current Protocol is Exist 55 | if (!aProtocol) { 56 | NSAssert1(self.ignoreSafeMode, @"【ProtocolServiceKit Debug Msg】%@ not Exist! If ignore,Please Setting `ProService.sharedManger.ignoreSafeMode` true", NSStringFromProtocol(aProtocol)); 57 | return nil; 58 | } 59 | // Normal Service Class 60 | NSString *serviceClassString = [NSStringFromProtocol(aProtocol) stringByReplacingOccurrencesOfString:ProServiceProtocolStringID withString:ProServiceClassStringID]; 61 | Class serviceClass = NSClassFromString(serviceClassString); 62 | if (!serviceClass) { 63 | // rule Class -> MapType Class 64 | serviceClass = [self tryMapServiceClassWithProtocol:aProtocol]; 65 | 66 | if (!serviceClass) { 67 | NSAssert1(self.ignoreSafeMode, @"【ProtocolServiceKit Debug Msg】%@ not exist Map Service Class! If ignore,Please Setting `ProService.sharedManger.ignoreSafeMode` true", NSStringFromProtocol(aProtocol)); 68 | } 69 | return serviceClass; 70 | } 71 | 72 | if (!serviceClass) { 73 | NSAssert1(self.ignoreSafeMode, @"【ProtocolServiceKit Debug Msg】%@ not existclasse[Rule&&Map Class! If ignore,Please Setting `ProService.sharedManger.ignoreSafeMode` true", NSStringFromProtocol(aProtocol)); 74 | return nil; 75 | } 76 | 77 | return [self checkServiceClass:serviceClass aProtocol:aProtocol isCache:isCache]; 78 | } 79 | 80 | #pragma mark - check Service Class 81 | 82 | - (Class)checkServiceClass:(Class)serviceClass 83 | aProtocol:(Protocol *)aProtocol 84 | isCache:(BOOL)isCache { 85 | // make Sure implClass conformsToProtocol then return ServiceClass 86 | if (serviceClass && [serviceClass conformsToProtocol:aProtocol]) { 87 | if (isCache) { 88 | [self.cacheDics setValue:serviceClass forKey:NSStringFromProtocol(aProtocol)]; 89 | } 90 | return serviceClass; 91 | } else { 92 | NSAssert1(self.ignoreSafeMode, @"【ProtocolServiceKit Debug Msg】%@ Not implementation Method or Not exist Service Class! If ignore,Please Setting `ProService.sharedManger.ignoreSafeMode` true",serviceClass); 93 | return nil; 94 | } 95 | } 96 | 97 | #pragma mark - map 98 | 99 | - (Class)tryMapServiceClassWithProtocol:(Protocol *)aProtocol { 100 | NSString *mapClassString = [self.mapDics objectForKey:NSStringFromProtocol(aProtocol)]; 101 | return NSClassFromString(mapClassString); 102 | } 103 | 104 | - (void)configProtocolServiceMapsWithDic:(NSDictionary < NSString * ,NSString *>*)mapDics { 105 | [mapDics enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull protocolKey, NSString * _Nonnull serviceClassString, BOOL * _Nonnull stop) { 106 | [self.mapDics setValue:serviceClassString forKey:protocolKey]; 107 | }]; 108 | } 109 | 110 | #pragma mark lazy propertys 111 | 112 | - (NSMutableDictionary *)cacheDics { 113 | if (!_cacheDics) { 114 | _cacheDics = [NSMutableDictionary dictionary]; 115 | } 116 | return _cacheDics; 117 | } 118 | 119 | - (NSMutableDictionary *)mapDics { 120 | if (!_mapDics) { 121 | _mapDics = [NSMutableDictionary dictionary]; 122 | } 123 | return _mapDics; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /ProtocolServiceKit/ProtocolServiceKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProtocolServiceKit.h 3 | // ProtocolServiceKit 4 | // 5 | // Created by Devdragonli on 16/8/2020. 6 | // 7 | 8 | #ifndef ProtocolServiceKit_h 9 | #define ProtocolServiceKit_h 10 | 11 | #if __has_include() 12 | #import 13 | 14 | #else 15 | 16 | #import "ProService.h" 17 | #endif 18 | 19 | #endif /* ProtocolServiceKit_h */ 20 | -------------------------------------------------------------------------------- /ProtocolServiceKit/Swift/ProtocolService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProtocolService.swift 3 | // ProtocolService 4 | // 5 | // Created by DevDragonLi on 3/12/2020. 6 | // Copyright © 2020 ServiceRouter. All rights reserved. 7 | 8 | // Swift Project user this Service Class 9 | 10 | import Foundation 11 | 12 | @objcMembers open class ProtocolService { 13 | 14 | static public func configIgnoreSafeMode(ignoreSafeMode:Bool) { 15 | ProService.sharedManger().ignoreSafeMode = ignoreSafeMode 16 | } 17 | 18 | static public func serviceClass(aProtocol:Protocol) -> AnyClass { 19 | return ProService.sharedManger().serviceClass(with: aProtocol) 20 | } 21 | 22 | static public func serviceCacheClass(aProtocol:Protocol) -> AnyClass { 23 | return ProService.sharedManger().serviceClass(withCachedProtocol: aProtocol) 24 | } 25 | 26 | static public func configProtocolServiceMaps(mapDic:[String:String]?,nameSpace:String?) { 27 | /* 28 | I wont want check Parmas this function!!! 29 | */ 30 | 31 | guard let mapDic = mapDic else { 32 | return 33 | } 34 | 35 | guard let nameSpace = nameSpace else { 36 | return 37 | } 38 | 39 | var nameSpaceMapDic = [String:String]() 40 | mapDic.forEach { key,value in 41 | let keyValue = nameSpace + "." + key 42 | let value = nameSpace + "." + value 43 | nameSpaceMapDic[keyValue] = value 44 | } 45 | ProService.sharedManger().configProtocolServiceMaps(withDic:nameSpaceMapDic) 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ProtocolServiceKit 2 | 3 |

4 |

5 | 6 | [![Version](https://img.shields.io/cocoapods/v/ProtocolServiceKit.svg?style=flat)](https://cocoapods.org/pods/ProtocolServiceKit) 7 | [![License](https://img.shields.io/cocoapods/l/ProtocolServiceKit.svg?style=flat)](https://cocoapods.org/pods/ProtocolServiceKit) 8 | [![Platform](https://img.shields.io/cocoapods/p/ProtocolServiceKit.svg?style=flat)](https://cocoapods.org/pods/ProtocolServiceKit) 9 |

10 | 11 |

12 |

13 | 14 | 15 | 16 |

17 | 18 | ### [业界常用的组件通信方案优缺点对比](#业界常用的组件通信方案) 19 | 20 | - [URL Router](#url-router) 21 | - [Target-Action](#target-action) 22 | - [Protocol-Class](#protocol-class) 23 | 24 | ### [ProtocolServiceKit](#protocolservicekit) 25 | 26 | > `东半球`最高效的 Protocol<=>Service 中间件,解决中间件的占用内存问题。 27 | 28 | - Support:ObjC/Swift项目(纯OC/Swift/混编)均可使用 29 | - Map && Cache 30 | - SafeMode 31 | 32 | ### [Installation](#installation) 33 | 34 | ### [ObjC/Swift Example](#OCExample) 35 | 36 | > 完善的中间件组件化示例工程 37 | 38 | - Use Example【Swift /ObjC】 39 | 40 | 41 | ### Q&A 42 | 43 | - 引入此中间件,如何**完全解耦**?(见下文) 44 | - 使用此组件,是否可以代码提醒函数功能? 45 | 46 | ## 业界常用的组件通信方案 47 | 48 | ### URL Router 49 | 50 | > 蘑菇街路线 51 | 52 | - 优点:方案成熟,极高的动态性,能解决组件依赖 ,易于适配 URL Scheme 53 | - 可多端复用 (方便地统一管理多平台的路由规则) ✅ 54 | - 缺点:需要注册维护URL表,编译阶段无法发现潜在BUG 🙅‍♂️ 55 | - 注册存在内存占用问题 56 | - 传参方式有限,并且**无法利用编译器进行参数类型检查**,因此所有的参数都只能从字符串中转换而来 57 | - 参数可以通过 protocol 58 | 直接传递,能够利用编译器检查参数类型,并且在 ZIKRouter 59 | 中,能通过路由声明和编译检查。 60 | - 要让 view controller 支持 61 | url,需要为其新增初始化方法,因此需要对模块做出修改 62 | - 不支持 storyboard 63 | - 无法明确声明模块提供的接口,只能依赖于接口文档,重构时无法确保修改正确 64 | - 无法保证所使用的模块一定存在 65 | - 解耦能力有限,url 66 | 的"注册"、"实现"、"使用"必须用相同的字符规则,一旦任何一方做出修改都会导致其他方的代码失效,并且重构难度大 67 | 68 | ### Target-Action 69 | 70 | - 优点:不需要注册和内存占用 ✅ 71 | 72 | - 缺点:编译阶段无法发现潜在BUG,必须遵守命名规则 🙅‍♂️ 73 | 74 | - 在 category 75 | 中仍然引入了字符串硬编码,内部使用字典传参,一定程度上也存在和 76 | URL 路由相同的问题 77 | - 字典传参的问题 78 | - 无法保证所使用的模块一定存在,target 79 | 模块在修改后,使用者只有在运行时才能发现错误 80 | - 过于依赖 runtime 特性,无法应用到纯 Swift 上。在 Swift 中扩展 81 | mediator 时,无法使用纯 Swift 类型的参数 82 | - 可能会创建过多的 target 类 83 | - 使用 runtime 84 | 相关的接口调用任意类的任意方法,需要注意别被苹果的审核误伤。 85 | 86 | ### Protocol-Class 87 | 88 | - 优点:接口与实现分离,编译阶段就能发现问题 ✅ 89 | 90 | - 缺点:需要注册和内存占用。 91 | - 由框架来创建所有对象,创建方式有限,例如不支持外部传入参数,再调用自定义初始化方法 92 | - 只做了 protocol 和 class 的匹配,不支持更复杂的创建方式和依赖注入 93 | - 无法保证所使用的 protocol 一定存在对应的模块,也无法直接判断某个 94 | protocol 是否能用于获取模块。 95 | 96 | ## ProtocolServiceKit 97 | 98 | > 基于Protocol-Class方案 99 | 100 | - 优点:同上`Protocol-Class`方案,但移除了注册逻辑,解决占用内存问题及Protocol对应ServiceClass存在性安全校验。 101 | 102 | - **Map** ✅ 103 | - 1.2.0 + Support 104 | - 可以不按照约定规则来提供ServiceClass,项目初始化/**需要处**提供map表机制,解决**强制**命名类规范问题,可自由自定义IMPClass。 105 | 106 | - **Cache** ✅ 107 | - 1.3.0 + Support。 108 | - 建议项目最常用到组件`Protocol`和`Service`使用。 109 | - Kit内部维护一张表,快速查找到对应的ServiceClass。 110 | 111 | - 安全模式 112 | 113 | > 对外业务能力如果未实现,运行期调用会触发断言处,便于发现问题 ✅ 114 | 115 | - 1.6.0 + (推荐2.1.0+) Support ✅ 116 | - 可选择关闭。但**不推荐忽略安全模式手动关闭**,便于及时发现问题。 117 | 118 | - 部分缺点同上`Protocol-Class` 119 | 120 | ## Installation 121 | 122 | > ProtocolServiceKit is available through [cocoapods](https://cocoapods.org/pods/ProtocolServiceKit). To install it, simply add the following line to your Podfile: 123 | 124 | ```ruby 125 | 126 | // OC项目建议参考下行 127 | pod 'ProtocolServiceKit',"~>2.2.1" # Default is ObjC 128 | 129 | // Swift项目建议参考下行 130 | pod 'ProtocolServiceKit/Swift',"~>2.2.1" 131 | 132 | // deprecate 133 | pod 'ProtocolServiceManger',"~>1.0.0" 134 | 135 | ``` 136 | 137 | ## ObjC Example 138 | 139 | > To run the example/SwiftExample project, clone the repo, and run `pod install` from the Example directory first. 140 | 141 | > 为了方便理解,AccountBusiness和PlayBusiness 已部署为远端示例组件,仅暴露Protocol文件 142 | 143 | ### Main API 144 | 145 | 146 | ```objc 147 | 148 | - (Class)serviceClassWithProtocol:(Protocol *)aProtocol; 149 | 150 | - (Class)serviceClassWithCachedProtocol:(Protocol *)cachedProtocol; 151 | 152 | - (void)configProtocolServiceMapsWithDic:(NSDictionary < NSString * ,NSString *> *)mapDics; 153 | 154 | ``` 155 | 156 | - AccountBusiness <=> PlayBusiness Example 157 | 158 | ```objc 159 | 160 | // VIP和播放业务复杂后,只公开Protocol文件决定业务对外能力 161 | // ServiceWithCachedProtocol 缓存使用 162 | 163 | Class vipService = ServiceWithProtocol(LFLVipProtocol); 164 | 165 | // 不直接使用对应账户类 [LFLAccountTool isUserVipStatus]; 166 | 167 | BOOL isVip = [vipService isCurrentUserVipStatus]; 168 | 169 | if (vipService && isVip) { 170 | [ServiceWithCachedProtocol(LFLPlayProtocol) playMiniVideo]; 171 | } else { 172 | NSLog(@"Error:LFLVipProtocol notfound service Class"); 173 | } 174 | 175 | ``` 176 | 177 | ```ObjC 178 | /// Default Value NO 【setting YES,ignore All Error Type 】 179 | @property (nonatomic,assign)BOOL ignoreSafeMode; 180 | 181 | ``` 182 | 183 | - recommended convention 184 | 185 | - `XXX`Service 186 | 187 | - `XXX`Protocol 188 | 189 | - 项目已存在或者想自由风格命名:**Map解决方案** 190 | 191 | ```objc 192 | 193 | NSDictionary *mapDic = @{ 194 | @"LFLUnRuleProtocol":@"LFLTestRuleIMP" 195 | }; 196 | [[ProService sharedManger] configProtocolServiceMapsWithDic:mapDic]; 197 | 198 | ``` 199 | 200 | ## Swift Example 201 | 202 | - ProtocolServiceKit.ProService 203 | 204 | - Swift版本有代码提示! 205 | 206 | ```Swift 207 | 208 | import ProtocolServiceKit.ProService 209 | 210 | func ProtocolServiceNormalDemo() { 211 | 212 | // 1.1 use 213 | let normalService : AnyClass = ProtocolService.serviceClass(aProtocol: SwiftNormalProtocol.self) 214 | 215 | // 1.2 Xcode can tip functions 216 | 217 | normalService.normalFunction() 218 | 219 | // 1.3 cache Service Class 220 | let normalCacheServiceDemo : AnyClass = ProtocolService.serviceCacheClass(aProtocol: SwiftNormalProtocol.self) 221 | normalCacheServiceDemo.normalFunction() 222 | 223 | // 2.0 recommend most use Example 224 | let normalCacheService : AnyClass = ProtocolService.serviceCacheClass(aProtocol: SwiftNormalProtocol.self) 225 | 226 | normalCacheService.normalFunction() 227 | 228 | } 229 | 230 | func ProtocolServiceMapDemo() { 231 | ProtocolService.configProtocolServiceMaps(mapDic: ["MapExampleProtocol":"MapUnRuleClass"], nameSpace: "SwiftExample") 232 | 233 | let mapCacheService : AnyClass = ProtocolService.serviceCacheClass(aProtocol: MapExampleProtocol.self) 234 | mapCacheService.MapExampleFunction() 235 | } 236 | 237 | ``` 238 | 239 | ### Q&A 240 | 241 | #### 建议组件之间通过明确的API接口交互,如果需要完全隔离(Example:A组件和B组件交互,不可以相互引用) 242 | - 对于接口层可以单独为轻量级组件(A和B业务组件均存在对应附属的协议层组件A-Protocol,B-Protocol)即可 243 | 244 | #### 使用此组件,是否可以代码提醒函数功能? 245 | 246 | > 一般不建议使用此版本 [ branch Function] 247 | 248 | - 支持对象函数调用提醒 249 | 250 | ``` 251 | // OC项目建议参考下行 252 | pod 'ProtocolServiceKit', :git => 'https://github.com/DevDragonLi/ProtocolServiceKit.git', :branch => 'tipFunction' # Default is ObjC 253 | // Swift项目建议参考下行 254 | pod 'ProtocolServiceKit/Swift', :git => 'https://github.com/DevDragonLi/ProtocolServiceKit.git', :branch => 'tipFunction' 255 | 256 | ``` 257 | 258 | #### 扩展:对于协议类可抽象出基类协议解决异常Case【视项目而定】 259 | - 无实现的API最终兜底方案。 260 | 261 | Author 262 | ------ 263 | 264 | DevdragonLi, dragonLi_52171@163.com 265 | 266 | License 267 | ------- 268 | 269 | ProtocolServiceKit is available under the MIT license. See the LICENSE 270 | file for more info. 271 | -------------------------------------------------------------------------------- /SwiftExample/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | platform :ios, '10.0' 4 | 5 | target 'SwiftExample' do 6 | 7 | pod 'ProtocolServiceKit/Swift', :path => '../' 8 | 9 | end 10 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 316717FDB138881554807F9F /* Pods_SwiftExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B41CCB7448BE4B254E54459 /* Pods_SwiftExample.framework */; }; 11 | 845484552515B9AD00F41D36 /* MapExampleProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845484542515B9AD00F41D36 /* MapExampleProtocol.swift */; }; 12 | 8454845B2515B9F800F41D36 /* MapUnRuleClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454845A2515B9F800F41D36 /* MapUnRuleClass.swift */; }; 13 | 8491DF5F24F1EE660046FB95 /* SwiftNormalProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8491DF5D24F1EE660046FB95 /* SwiftNormalProtocol.swift */; }; 14 | 8491DF6024F1EE660046FB95 /* SwiftNormalService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8491DF5E24F1EE660046FB95 /* SwiftNormalService.swift */; }; 15 | 84E9DC7424E98ED500887623 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E9DC7324E98ED500887623 /* AppDelegate.swift */; }; 16 | 84E9DC7824E98ED500887623 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E9DC7724E98ED500887623 /* ViewController.swift */; }; 17 | 84E9DC7B24E98ED500887623 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84E9DC7924E98ED500887623 /* Main.storyboard */; }; 18 | 84E9DC7D24E98ED600887623 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84E9DC7C24E98ED600887623 /* Assets.xcassets */; }; 19 | 84E9DC8024E98ED600887623 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84E9DC7E24E98ED600887623 /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 48007EA33EF5AFBD9AA720E4 /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = ""; }; 24 | 4A5D39F3BDFF08EF437AB72D /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = ""; }; 25 | 7B41CCB7448BE4B254E54459 /* Pods_SwiftExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 845484542515B9AD00F41D36 /* MapExampleProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapExampleProtocol.swift; sourceTree = ""; }; 27 | 8454845A2515B9F800F41D36 /* MapUnRuleClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapUnRuleClass.swift; sourceTree = ""; }; 28 | 8491DF5D24F1EE660046FB95 /* SwiftNormalProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftNormalProtocol.swift; sourceTree = ""; }; 29 | 8491DF5E24F1EE660046FB95 /* SwiftNormalService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftNormalService.swift; sourceTree = ""; }; 30 | 84E9DC7024E98ED500887623 /* SwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 84E9DC7324E98ED500887623 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 32 | 84E9DC7724E98ED500887623 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 33 | 84E9DC7A24E98ED500887623 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | 84E9DC7C24E98ED600887623 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 35 | 84E9DC7F24E98ED600887623 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 36 | 84E9DC8124E98ED600887623 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 84E9DC6D24E98ED500887623 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | 316717FDB138881554807F9F /* Pods_SwiftExample.framework in Frameworks */, 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 4B714F3FDBEADAD51D912A77 /* Pods */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | 4A5D39F3BDFF08EF437AB72D /* Pods-SwiftExample.debug.xcconfig */, 55 | 48007EA33EF5AFBD9AA720E4 /* Pods-SwiftExample.release.xcconfig */, 56 | ); 57 | path = Pods; 58 | sourceTree = ""; 59 | }; 60 | 5F5EA5FB49738A34C08F3729 /* Frameworks */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 7B41CCB7448BE4B254E54459 /* Pods_SwiftExample.framework */, 64 | ); 65 | name = Frameworks; 66 | sourceTree = ""; 67 | }; 68 | 845484662515BB3900F41D36 /* Map */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 845484542515B9AD00F41D36 /* MapExampleProtocol.swift */, 72 | 8454845A2515B9F800F41D36 /* MapUnRuleClass.swift */, 73 | ); 74 | path = Map; 75 | sourceTree = ""; 76 | }; 77 | 8491DF5C24F1EE660046FB95 /* Normal */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 8491DF5D24F1EE660046FB95 /* SwiftNormalProtocol.swift */, 81 | 8491DF5E24F1EE660046FB95 /* SwiftNormalService.swift */, 82 | ); 83 | path = Normal; 84 | sourceTree = ""; 85 | }; 86 | 84E9DC6724E98ED500887623 = { 87 | isa = PBXGroup; 88 | children = ( 89 | 84E9DC7224E98ED500887623 /* SwiftExample */, 90 | 84E9DC7124E98ED500887623 /* Products */, 91 | 4B714F3FDBEADAD51D912A77 /* Pods */, 92 | 5F5EA5FB49738A34C08F3729 /* Frameworks */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 84E9DC7124E98ED500887623 /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 84E9DC7024E98ED500887623 /* SwiftExample.app */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 84E9DC7224E98ED500887623 /* SwiftExample */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 84E9DC7324E98ED500887623 /* AppDelegate.swift */, 108 | 845484662515BB3900F41D36 /* Map */, 109 | 8491DF5C24F1EE660046FB95 /* Normal */, 110 | 84E9DC7724E98ED500887623 /* ViewController.swift */, 111 | 84E9DC7924E98ED500887623 /* Main.storyboard */, 112 | 84E9DC7C24E98ED600887623 /* Assets.xcassets */, 113 | 84E9DC7E24E98ED600887623 /* LaunchScreen.storyboard */, 114 | 84E9DC8124E98ED600887623 /* Info.plist */, 115 | ); 116 | path = SwiftExample; 117 | sourceTree = ""; 118 | }; 119 | /* End PBXGroup section */ 120 | 121 | /* Begin PBXNativeTarget section */ 122 | 84E9DC6F24E98ED500887623 /* SwiftExample */ = { 123 | isa = PBXNativeTarget; 124 | buildConfigurationList = 84E9DC8424E98ED600887623 /* Build configuration list for PBXNativeTarget "SwiftExample" */; 125 | buildPhases = ( 126 | D3BC615F0C02A29A5660BA79 /* [CP] Check Pods Manifest.lock */, 127 | 84E9DC6C24E98ED500887623 /* Sources */, 128 | 84E9DC6D24E98ED500887623 /* Frameworks */, 129 | 84E9DC6E24E98ED500887623 /* Resources */, 130 | 076C7775B063CF1419981866 /* [CP] Embed Pods Frameworks */, 131 | ); 132 | buildRules = ( 133 | ); 134 | dependencies = ( 135 | ); 136 | name = SwiftExample; 137 | productName = SwiftExample; 138 | productReference = 84E9DC7024E98ED500887623 /* SwiftExample.app */; 139 | productType = "com.apple.product-type.application"; 140 | }; 141 | /* End PBXNativeTarget section */ 142 | 143 | /* Begin PBXProject section */ 144 | 84E9DC6824E98ED500887623 /* Project object */ = { 145 | isa = PBXProject; 146 | attributes = { 147 | LastSwiftUpdateCheck = 1160; 148 | LastUpgradeCheck = 1200; 149 | ORGANIZATIONNAME = zd; 150 | TargetAttributes = { 151 | 84E9DC6F24E98ED500887623 = { 152 | CreatedOnToolsVersion = 11.6; 153 | }; 154 | }; 155 | }; 156 | buildConfigurationList = 84E9DC6B24E98ED500887623 /* Build configuration list for PBXProject "SwiftExample" */; 157 | compatibilityVersion = "Xcode 9.3"; 158 | developmentRegion = en; 159 | hasScannedForEncodings = 0; 160 | knownRegions = ( 161 | en, 162 | Base, 163 | ); 164 | mainGroup = 84E9DC6724E98ED500887623; 165 | productRefGroup = 84E9DC7124E98ED500887623 /* Products */; 166 | projectDirPath = ""; 167 | projectRoot = ""; 168 | targets = ( 169 | 84E9DC6F24E98ED500887623 /* SwiftExample */, 170 | ); 171 | }; 172 | /* End PBXProject section */ 173 | 174 | /* Begin PBXResourcesBuildPhase section */ 175 | 84E9DC6E24E98ED500887623 /* Resources */ = { 176 | isa = PBXResourcesBuildPhase; 177 | buildActionMask = 2147483647; 178 | files = ( 179 | 84E9DC8024E98ED600887623 /* LaunchScreen.storyboard in Resources */, 180 | 84E9DC7D24E98ED600887623 /* Assets.xcassets in Resources */, 181 | 84E9DC7B24E98ED500887623 /* Main.storyboard in Resources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXResourcesBuildPhase section */ 186 | 187 | /* Begin PBXShellScriptBuildPhase section */ 188 | 076C7775B063CF1419981866 /* [CP] Embed Pods Frameworks */ = { 189 | isa = PBXShellScriptBuildPhase; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | ); 193 | inputFileListPaths = ( 194 | "${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", 195 | ); 196 | name = "[CP] Embed Pods Frameworks"; 197 | outputFileListPaths = ( 198 | "${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | shellPath = /bin/sh; 202 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n"; 203 | showEnvVarsInLog = 0; 204 | }; 205 | D3BC615F0C02A29A5660BA79 /* [CP] Check Pods Manifest.lock */ = { 206 | isa = PBXShellScriptBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | ); 210 | inputFileListPaths = ( 211 | ); 212 | inputPaths = ( 213 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 214 | "${PODS_ROOT}/Manifest.lock", 215 | ); 216 | name = "[CP] Check Pods Manifest.lock"; 217 | outputFileListPaths = ( 218 | ); 219 | outputPaths = ( 220 | "$(DERIVED_FILE_DIR)/Pods-SwiftExample-checkManifestLockResult.txt", 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | shellPath = /bin/sh; 224 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 225 | showEnvVarsInLog = 0; 226 | }; 227 | /* End PBXShellScriptBuildPhase section */ 228 | 229 | /* Begin PBXSourcesBuildPhase section */ 230 | 84E9DC6C24E98ED500887623 /* Sources */ = { 231 | isa = PBXSourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | 8454845B2515B9F800F41D36 /* MapUnRuleClass.swift in Sources */, 235 | 8491DF5F24F1EE660046FB95 /* SwiftNormalProtocol.swift in Sources */, 236 | 845484552515B9AD00F41D36 /* MapExampleProtocol.swift in Sources */, 237 | 84E9DC7824E98ED500887623 /* ViewController.swift in Sources */, 238 | 84E9DC7424E98ED500887623 /* AppDelegate.swift in Sources */, 239 | 8491DF6024F1EE660046FB95 /* SwiftNormalService.swift in Sources */, 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | /* End PBXSourcesBuildPhase section */ 244 | 245 | /* Begin PBXVariantGroup section */ 246 | 84E9DC7924E98ED500887623 /* Main.storyboard */ = { 247 | isa = PBXVariantGroup; 248 | children = ( 249 | 84E9DC7A24E98ED500887623 /* Base */, 250 | ); 251 | name = Main.storyboard; 252 | sourceTree = ""; 253 | }; 254 | 84E9DC7E24E98ED600887623 /* LaunchScreen.storyboard */ = { 255 | isa = PBXVariantGroup; 256 | children = ( 257 | 84E9DC7F24E98ED600887623 /* Base */, 258 | ); 259 | name = LaunchScreen.storyboard; 260 | sourceTree = ""; 261 | }; 262 | /* End PBXVariantGroup section */ 263 | 264 | /* Begin XCBuildConfiguration section */ 265 | 84E9DC8224E98ED600887623 /* Debug */ = { 266 | isa = XCBuildConfiguration; 267 | buildSettings = { 268 | ALWAYS_SEARCH_USER_PATHS = NO; 269 | CLANG_ANALYZER_NONNULL = YES; 270 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 271 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 272 | CLANG_CXX_LIBRARY = "libc++"; 273 | CLANG_ENABLE_MODULES = YES; 274 | CLANG_ENABLE_OBJC_ARC = YES; 275 | CLANG_ENABLE_OBJC_WEAK = YES; 276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 277 | CLANG_WARN_BOOL_CONVERSION = YES; 278 | CLANG_WARN_COMMA = YES; 279 | CLANG_WARN_CONSTANT_CONVERSION = YES; 280 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 281 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 282 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 283 | CLANG_WARN_EMPTY_BODY = YES; 284 | CLANG_WARN_ENUM_CONVERSION = YES; 285 | CLANG_WARN_INFINITE_RECURSION = YES; 286 | CLANG_WARN_INT_CONVERSION = YES; 287 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 288 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 289 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 290 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 291 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 292 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 293 | CLANG_WARN_STRICT_PROTOTYPES = YES; 294 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 295 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 296 | CLANG_WARN_UNREACHABLE_CODE = YES; 297 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 298 | COPY_PHASE_STRIP = NO; 299 | DEBUG_INFORMATION_FORMAT = dwarf; 300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 301 | ENABLE_TESTABILITY = YES; 302 | GCC_C_LANGUAGE_STANDARD = gnu11; 303 | GCC_DYNAMIC_NO_PIC = NO; 304 | GCC_NO_COMMON_BLOCKS = YES; 305 | GCC_OPTIMIZATION_LEVEL = 0; 306 | GCC_PREPROCESSOR_DEFINITIONS = ( 307 | "DEBUG=1", 308 | "$(inherited)", 309 | ); 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 317 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 318 | MTL_FAST_MATH = YES; 319 | ONLY_ACTIVE_ARCH = YES; 320 | SDKROOT = iphoneos; 321 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 322 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 323 | }; 324 | name = Debug; 325 | }; 326 | 84E9DC8324E98ED600887623 /* Release */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_ANALYZER_NONNULL = YES; 331 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 332 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 333 | CLANG_CXX_LIBRARY = "libc++"; 334 | CLANG_ENABLE_MODULES = YES; 335 | CLANG_ENABLE_OBJC_ARC = YES; 336 | CLANG_ENABLE_OBJC_WEAK = YES; 337 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_COMMA = YES; 340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 341 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 343 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 344 | CLANG_WARN_EMPTY_BODY = YES; 345 | CLANG_WARN_ENUM_CONVERSION = YES; 346 | CLANG_WARN_INFINITE_RECURSION = YES; 347 | CLANG_WARN_INT_CONVERSION = YES; 348 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 349 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 350 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 352 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 353 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 354 | CLANG_WARN_STRICT_PROTOTYPES = YES; 355 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 356 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | COPY_PHASE_STRIP = NO; 360 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 361 | ENABLE_NS_ASSERTIONS = NO; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | GCC_C_LANGUAGE_STANDARD = gnu11; 364 | GCC_NO_COMMON_BLOCKS = YES; 365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 367 | GCC_WARN_UNDECLARED_SELECTOR = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 369 | GCC_WARN_UNUSED_FUNCTION = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 372 | MTL_ENABLE_DEBUG_INFO = NO; 373 | MTL_FAST_MATH = YES; 374 | SDKROOT = iphoneos; 375 | SWIFT_COMPILATION_MODE = wholemodule; 376 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 377 | VALIDATE_PRODUCT = YES; 378 | }; 379 | name = Release; 380 | }; 381 | 84E9DC8524E98ED600887623 /* Debug */ = { 382 | isa = XCBuildConfiguration; 383 | baseConfigurationReference = 4A5D39F3BDFF08EF437AB72D /* Pods-SwiftExample.debug.xcconfig */; 384 | buildSettings = { 385 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 386 | CODE_SIGN_STYLE = Automatic; 387 | DEVELOPMENT_TEAM = 4WB3QMP893; 388 | INFOPLIST_FILE = SwiftExample/Info.plist; 389 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 390 | LD_RUNPATH_SEARCH_PATHS = ( 391 | "$(inherited)", 392 | "@executable_path/Frameworks", 393 | ); 394 | PRODUCT_BUNDLE_IDENTIFIER = com.Example.SwiftExample; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | SWIFT_VERSION = 5.0; 397 | TARGETED_DEVICE_FAMILY = "1,2"; 398 | }; 399 | name = Debug; 400 | }; 401 | 84E9DC8624E98ED600887623 /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | baseConfigurationReference = 48007EA33EF5AFBD9AA720E4 /* Pods-SwiftExample.release.xcconfig */; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | CODE_SIGN_STYLE = Automatic; 407 | INFOPLIST_FILE = SwiftExample/Info.plist; 408 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 409 | LD_RUNPATH_SEARCH_PATHS = ( 410 | "$(inherited)", 411 | "@executable_path/Frameworks", 412 | ); 413 | PRODUCT_BUNDLE_IDENTIFIER = com.Example.SwiftExample; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | SWIFT_VERSION = 5.0; 416 | TARGETED_DEVICE_FAMILY = "1,2"; 417 | }; 418 | name = Release; 419 | }; 420 | /* End XCBuildConfiguration section */ 421 | 422 | /* Begin XCConfigurationList section */ 423 | 84E9DC6B24E98ED500887623 /* Build configuration list for PBXProject "SwiftExample" */ = { 424 | isa = XCConfigurationList; 425 | buildConfigurations = ( 426 | 84E9DC8224E98ED600887623 /* Debug */, 427 | 84E9DC8324E98ED600887623 /* Release */, 428 | ); 429 | defaultConfigurationIsVisible = 0; 430 | defaultConfigurationName = Release; 431 | }; 432 | 84E9DC8424E98ED600887623 /* Build configuration list for PBXNativeTarget "SwiftExample" */ = { 433 | isa = XCConfigurationList; 434 | buildConfigurations = ( 435 | 84E9DC8524E98ED600887623 /* Debug */, 436 | 84E9DC8624E98ED600887623 /* Release */, 437 | ); 438 | defaultConfigurationIsVisible = 0; 439 | defaultConfigurationName = Release; 440 | }; 441 | /* End XCConfigurationList section */ 442 | }; 443 | rootObject = 84E9DC6824E98ED500887623 /* Project object */; 444 | } 445 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftExample 4 | // 5 | // Created by Devdragonli on 16/8/2020. 6 | // Copyright © 2020 Devdragonli. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ProtocolServiceKit 11 | @UIApplicationMain 12 | 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | self.window = UIWindow.init() 19 | self.window?.rootViewController = ViewController.init() 20 | self.window?.makeKeyAndVisible() 21 | return true 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/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 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/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 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | 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 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/Map/MapExampleProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapExampleProtocol.swift 3 | // SwiftExample 4 | // 5 | // Created by DevdragonLi on 19/9/2020. 6 | // Copyright © 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | @objc public protocol MapExampleProtocol { 12 | 13 | static func MapExampleFunction() 14 | } 15 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/Map/MapUnRuleClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapUnRuleClass.swift 3 | // SwiftExample 4 | // 5 | // Created by DevdragonLi on 19/9/2020. 6 | // Copyright © 2020 DevdragonLi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class MapUnRuleClass:MapExampleProtocol { 12 | 13 | static public func MapExampleFunction() { 14 | print("MapExampleFunction Run !") 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/Normal/SwiftNormalProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftNormalProtocol.swift 3 | // SwiftExample 4 | // 5 | // Created by Devdragonli on 17/8/2020. 6 | // Copyright © 2020 Devdragonli. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | @objc public protocol SwiftNormalProtocol { 12 | 13 | static func normalFunction() 14 | } 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/Normal/SwiftNormalService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftTestService.swift 3 | // SwiftExample 4 | // 5 | // Created by Devdragonli on 17/8/2020. 6 | // Copyright © 2020 Devdragonli. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class SwiftNormalService:SwiftNormalProtocol { 12 | 13 | static public func normalFunction() { 14 | print("SwiftNormalService") 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /SwiftExample/SwiftExample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SwiftExample 4 | // 5 | // Created by Devdragonli on 16/8/2020. 6 | // Copyright © 2020 Devdragonli. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ProtocolServiceKit.ProService 11 | 12 | class ViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | view.backgroundColor = .gray 17 | ProtocolServiceNormalDemo() 18 | ProtocolServiceMapDemo() 19 | } 20 | 21 | func ProtocolServiceNormalDemo() { 22 | 23 | // 1.1 use 24 | let normalService : AnyClass = ProtocolService.serviceClass(aProtocol: SwiftNormalProtocol.self) 25 | 26 | // 1.2 Xcode can tip functions 27 | 28 | normalService.normalFunction() 29 | 30 | // 1.3 cache Service Class 31 | let normalCacheServiceDemo : AnyClass = ProtocolService.serviceCacheClass(aProtocol: SwiftNormalProtocol.self) 32 | normalCacheServiceDemo.normalFunction() 33 | 34 | // 2.0 recommend most use Example 35 | let normalCacheService : AnyClass = ProtocolService.serviceCacheClass(aProtocol: SwiftNormalProtocol.self) 36 | 37 | normalCacheService.normalFunction() 38 | 39 | } 40 | 41 | func ProtocolServiceMapDemo() { 42 | ProtocolService.configProtocolServiceMaps(mapDic: ["MapExampleProtocol":"MapUnRuleClass"], nameSpace: nil) 43 | ProtocolService.configProtocolServiceMaps(mapDic: ["MapExampleProtocol":"MapUnRuleClass"], nameSpace: "SwiftExample") 44 | let mapCacheService : AnyClass = ProtocolService.serviceCacheClass(aProtocol: MapExampleProtocol.self) 45 | mapCacheService.MapExampleFunction() 46 | } 47 | 48 | } 49 | 50 | --------------------------------------------------------------------------------