├── .gitignore ├── .gitlab-ci.yml ├── .travis.yml ├── Example ├── .gitlab-ci.yml ├── Podfile ├── Podfile.lock ├── TDFModuleKit.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── TDFModuleKit-Example.xcscheme ├── TDFModuleKit.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── TDFModuleKit │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── TDFAModule.h │ ├── TDFAModule.m │ ├── TDFAppDelegate.h │ ├── TDFAppDelegate.m │ ├── TDFBModule.h │ ├── TDFBModule.m │ ├── TDFCModule.h │ ├── TDFCModule.m │ ├── TDFModuleKit-Info.plist │ ├── TDFModuleKit-Prefix.pch │ ├── TDFViewController.h │ ├── TDFViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── README.md ├── TDFModuleKit.podspec ├── TDFModuleKit ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── TDFApplicationDelegateProxy.h │ ├── TDFApplicationDelegateProxy.m │ ├── TDFModule.h │ ├── TDFModule.m │ ├── TDFModuleKit.h │ ├── TDFModuleManager.h │ └── TDFModuleManager.m └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | 19 | #CocoaPods 20 | Pods 21 | 22 | *.framework 23 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | # 二进制优先, lint、package、publish 会有 --binary-first option 3 | BINARY_FIRST: 1 4 | # 不允许通知 5 | DISABLE_NOTIFY: 0 6 | 7 | before_script: 8 | # https://gitlab.com/gitlab-org/gitlab-ce/issues/14983 9 | # shared runner 会出现,special runner只会报warning 10 | - export LANG=en_US.UTF-8 11 | - export LANGUAGE=en_US:en 12 | - export LC_ALL=en_US.UTF-8 13 | 14 | - pwd 15 | - git clone git@git.2dfire.net:ios/ci-yaml-shell.git 16 | - ci-yaml-shell/before_shell_executor.sh 17 | 18 | after_script: 19 | - rm -fr ci-yaml-shell 20 | 21 | stages: 22 | - check 23 | - lint 24 | - test 25 | - package 26 | - binary_lint 27 | - publish 28 | - report 29 | - cleanup 30 | 31 | component_check: 32 | stage: check 33 | script: 34 | - ci-yaml-shell/component_check_executor.rb 35 | only: 36 | - master 37 | - /^release.*$/ 38 | - /^hotfix.*$/ 39 | - tags 40 | - CI 41 | tags: 42 | - iOSCI 43 | environment: 44 | name: qa 45 | 46 | lib_lint: 47 | stage: lint 48 | only: 49 | - master 50 | - /^release.*$/ 51 | - /^hotfix.*$/ 52 | # - tags 53 | - CI 54 | retry: 0 55 | script: 56 | - ci-yaml-shell/lib_lint_executor.sh 57 | tags: 58 | - iOSCI 59 | environment: 60 | name: qa 61 | # oc_lint: 62 | # stage: lint 63 | # only: 64 | # - master 65 | # # - /^release.*$/ 66 | # - CI 67 | # retry: 0 68 | # script: 69 | # - ci-yaml-shell/oclint_executor.sh lint_result 70 | # after_script: 71 | # - cat lint_result | python -m json.tool 72 | # tags: 73 | # - iOS 74 | 75 | # unit_test: 76 | # stage: test 77 | # only: 78 | # - master 79 | # # - /^release.*$/ 80 | # - CI 81 | # retry: 1 82 | # script: 83 | # - ci-yaml-shell/unit_test_executor.sh 84 | # tags: 85 | # - iOSCI 86 | # environment: 87 | # name: qa 88 | 89 | package_framework: 90 | stage: package 91 | only: 92 | - tags 93 | script: 94 | - ci-yaml-shell/framework_pack_executor.sh 95 | tags: 96 | - iOSCD 97 | environment: 98 | name: production 99 | 100 | # binary_lint: 101 | # stage: binary_lint 102 | # only: 103 | # - tags 104 | # retry: 1 105 | # script: 106 | # - ci-yaml-shell/binary_lint_executor.sh 107 | # tags: 108 | # - iOS 109 | 110 | publish_pod: 111 | stage: publish 112 | only: 113 | - tags 114 | retry: 0 115 | script: 116 | - ci-yaml-shell/publish_executor.sh 117 | tags: 118 | - iOSCD 119 | environment: 120 | name: production 121 | # allow_failure: true 122 | 123 | report_to_director: 124 | stage: report 125 | script: 126 | - ci-yaml-shell/report_executor.sh 127 | only: 128 | - master 129 | - tags 130 | when: on_failure 131 | tags: 132 | - iOSCD 133 | 134 | # cleanup: 135 | # only: 136 | # - master 137 | # - /^release.*$/ 138 | # - tags 139 | # stage: cleanup 140 | # script: 141 | # - ci-yaml-shell/cleanup_executor.sh 142 | # when: always 143 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/TDFModuleKit.xcworkspace -scheme TDFModuleKit-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | before_script: 2 | # https://gitlab.com/gitlab-org/gitlab-ce/issues/14983 3 | # shared runner 会出现,special runner只会报warning 4 | - export LANG=en_US.UTF-8 5 | - export LANGUAGE=en_US:en 6 | - export LC_ALL=en_US.UTF-8 7 | 8 | - pwd 9 | - ruby -v 10 | - gem install cocoapods --no-ri --no-rdoc 11 | - gem install xcpretty --no-ri --no-rdoc 12 | - pod --version 13 | #- pod cache clean --all 14 | - git clone git@git.2dfire-inc.com:ios/ci-yaml-shell.git 15 | - gem uninstall cocoapods-tdfire-binary --all 16 | - gem install cocoapods-tdfire-binary 17 | #- gem install specific_install 18 | #- gem specific_install -l git@git.2dfire-inc.com:ios/cocoapods-tdfire.git 19 | 20 | after_script: 21 | - rm -fr ci-yaml-shell 22 | 23 | stages: 24 | - lint 25 | - test 26 | - package 27 | - binary_lint 28 | - publish 29 | - report 30 | - cleanup 31 | 32 | # lib_lint: 33 | # stage: lint 34 | # retry: 2 35 | # script: 36 | # - ci-yaml-shell/lib_lint_executor.sh 37 | # tags: 38 | # - iOS 39 | 40 | # oc_lint: 41 | # stage: lint 42 | # script: 43 | # - ci-yaml-shell/oclint_executor.sh lint_result 44 | # after_script: 45 | # - cat lint_result | python -m json.tool 46 | # tags: 47 | # - iOS 48 | 49 | # unit_test: 50 | # stage: test 51 | # script: 52 | # - ci-yaml-shell/unit_test_executor.sh 53 | # tags: 54 | # - iOS 55 | 56 | package_framework: 57 | stage: package 58 | only: 59 | - tags 60 | script: 61 | - ci-yaml-shell/framework_pack_executor.sh 62 | tags: 63 | - iOS 64 | 65 | binary_lint: 66 | stage: binary_lint 67 | only: 68 | - tags 69 | script: 70 | - ci-yaml-shell/lib_lint_executor.sh 71 | tags: 72 | - iOS 73 | 74 | publish_pod: 75 | stage: publish 76 | only: 77 | - tags 78 | retry: 2 79 | script: 80 | - ci-yaml-shell/publish_executor.sh 81 | tags: 82 | - iOS 83 | # allow_failure: true 84 | 85 | report_to_director: 86 | stage: report 87 | script: 88 | - ci-yaml-shell/report_executor.sh 89 | only: 90 | - master 91 | - develop 92 | - tags 93 | when: on_failure 94 | tags: 95 | - iOS 96 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'git@git.2dfire.net:ios/cocoapods-spec.git' 2 | 3 | plugin 'cocoapods-tdfire-binary' 4 | 5 | use_frameworks! 6 | 7 | target 'TDFModuleKit_Example' do 8 | pod 'TDFModuleKit', :path => '../' 9 | 10 | target 'TDFModuleKit_Tests' do 11 | inherit! :search_paths 12 | 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - TDFModuleKit (1.0.4) 3 | 4 | DEPENDENCIES: 5 | - TDFModuleKit (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | TDFModuleKit: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | TDFModuleKit: b382fbfca910c26626a0ad699b76fc97a653b8d0 13 | 14 | PODFILE CHECKSUM: 1c4cf0b10d8a68a750f0472c02421849c14fcd17 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /Example/TDFModuleKit.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0BCFD8F76321489F5013D1D4 /* Pods_TDFModuleKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F66781726D0D3581671607CB /* Pods_TDFModuleKit_Tests.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 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 15 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 16 | 6003F59E195388D20070C39A /* TDFAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* TDFAppDelegate.m */; }; 17 | 6003F5A7195388D20070C39A /* TDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* TDFViewController.m */; }; 18 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 19 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 20 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 21 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 22 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 23 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 24 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 25 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 26 | B78666B60CF2DBDFF6B668EA /* Pods_TDFModuleKit_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66CBF6C61E5FCBF496FB3A38 /* Pods_TDFModuleKit_Example.framework */; }; 27 | BE727118209468F500E406C1 /* TDFAModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D63BB1B61F9E1FC600574241 /* TDFAModule.m */; }; 28 | BE727119209468F500E406C1 /* TDFBModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D63BB1B91F9E1FCF00574241 /* TDFBModule.m */; }; 29 | BE72711A209468F500E406C1 /* TDFCModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D626DFA21F9EE341008CF95E /* TDFCModule.m */; }; 30 | BE72711B209468F900E406C1 /* TDFAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* TDFAppDelegate.m */; }; 31 | D626DFA31F9EE341008CF95E /* TDFCModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D626DFA21F9EE341008CF95E /* TDFCModule.m */; }; 32 | D63BB1B71F9E1FC600574241 /* TDFAModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D63BB1B61F9E1FC600574241 /* TDFAModule.m */; }; 33 | D63BB1BA1F9E1FCF00574241 /* TDFBModule.m in Sources */ = {isa = PBXBuildFile; fileRef = D63BB1B91F9E1FCF00574241 /* TDFBModule.m */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 6003F582195388D10070C39A /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = 6003F589195388D20070C39A; 42 | remoteInfo = TDFModuleKit; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 0941E41C9E7AD90163929A2F /* Pods-TDFModuleKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDFModuleKit_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TDFModuleKit_Tests/Pods-TDFModuleKit_Tests.release.xcconfig"; sourceTree = ""; }; 48 | 1268AF3BB9DDF999003C04E0 /* Pods-TDFModuleKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDFModuleKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TDFModuleKit_Example/Pods-TDFModuleKit_Example.debug.xcconfig"; sourceTree = ""; }; 49 | 3036DE8576E1022CEEBF9B1A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 50 | 3CB843AF5B0A691E08D8B9F8 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 51 | 51B4B582F916973FC3EB2F9E /* Pods-TDFModuleKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDFModuleKit_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-TDFModuleKit_Example/Pods-TDFModuleKit_Example.release.xcconfig"; sourceTree = ""; }; 52 | 6003F58A195388D20070C39A /* TDFModuleKit_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TDFModuleKit_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 54 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 55 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 56 | 6003F595195388D20070C39A /* TDFModuleKit-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TDFModuleKit-Info.plist"; sourceTree = ""; }; 57 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 58 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 59 | 6003F59B195388D20070C39A /* TDFModuleKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TDFModuleKit-Prefix.pch"; sourceTree = ""; }; 60 | 6003F59C195388D20070C39A /* TDFAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDFAppDelegate.h; sourceTree = ""; }; 61 | 6003F59D195388D20070C39A /* TDFAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TDFAppDelegate.m; sourceTree = ""; }; 62 | 6003F5A5195388D20070C39A /* TDFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDFViewController.h; sourceTree = ""; }; 63 | 6003F5A6195388D20070C39A /* TDFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TDFViewController.m; sourceTree = ""; }; 64 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 65 | 6003F5AE195388D20070C39A /* TDFModuleKit_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TDFModuleKit_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 67 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 68 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 69 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 70 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 71 | 66CBF6C61E5FCBF496FB3A38 /* Pods_TDFModuleKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TDFModuleKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 73 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 74 | 9A594D8EFD47ED7AD40F1349 /* Pods-TDFModuleKit_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TDFModuleKit_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TDFModuleKit_Tests/Pods-TDFModuleKit_Tests.debug.xcconfig"; sourceTree = ""; }; 75 | BBF100DBAF5190614B5073B6 /* TDFModuleKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = TDFModuleKit.podspec; path = ../TDFModuleKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 76 | D626DFA11F9EE341008CF95E /* TDFCModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDFCModule.h; sourceTree = ""; }; 77 | D626DFA21F9EE341008CF95E /* TDFCModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TDFCModule.m; sourceTree = ""; }; 78 | D63BB1B51F9E1FC600574241 /* TDFAModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDFAModule.h; sourceTree = ""; }; 79 | D63BB1B61F9E1FC600574241 /* TDFAModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TDFAModule.m; sourceTree = ""; }; 80 | D63BB1B81F9E1FCF00574241 /* TDFBModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TDFBModule.h; sourceTree = ""; }; 81 | D63BB1B91F9E1FCF00574241 /* TDFBModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TDFBModule.m; sourceTree = ""; }; 82 | F66781726D0D3581671607CB /* Pods_TDFModuleKit_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TDFModuleKit_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | /* End PBXFileReference section */ 84 | 85 | /* Begin PBXFrameworksBuildPhase section */ 86 | 6003F587195388D20070C39A /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 91 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 92 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 93 | B78666B60CF2DBDFF6B668EA /* Pods_TDFModuleKit_Example.framework in Frameworks */, 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | 6003F5AB195388D20070C39A /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 102 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 103 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 104 | 0BCFD8F76321489F5013D1D4 /* Pods_TDFModuleKit_Tests.framework in Frameworks */, 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | /* End PBXFrameworksBuildPhase section */ 109 | 110 | /* Begin PBXGroup section */ 111 | 6003F581195388D10070C39A = { 112 | isa = PBXGroup; 113 | children = ( 114 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 115 | 6003F593195388D20070C39A /* Example for TDFModuleKit */, 116 | 6003F5B5195388D20070C39A /* Tests */, 117 | 6003F58C195388D20070C39A /* Frameworks */, 118 | 6003F58B195388D20070C39A /* Products */, 119 | 818F137A8DB46C0FA0037574 /* Pods */, 120 | ); 121 | sourceTree = ""; 122 | }; 123 | 6003F58B195388D20070C39A /* Products */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 6003F58A195388D20070C39A /* TDFModuleKit_Example.app */, 127 | 6003F5AE195388D20070C39A /* TDFModuleKit_Tests.xctest */, 128 | ); 129 | name = Products; 130 | sourceTree = ""; 131 | }; 132 | 6003F58C195388D20070C39A /* Frameworks */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 6003F58D195388D20070C39A /* Foundation.framework */, 136 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 137 | 6003F591195388D20070C39A /* UIKit.framework */, 138 | 6003F5AF195388D20070C39A /* XCTest.framework */, 139 | 66CBF6C61E5FCBF496FB3A38 /* Pods_TDFModuleKit_Example.framework */, 140 | F66781726D0D3581671607CB /* Pods_TDFModuleKit_Tests.framework */, 141 | ); 142 | name = Frameworks; 143 | sourceTree = ""; 144 | }; 145 | 6003F593195388D20070C39A /* Example for TDFModuleKit */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 6003F59C195388D20070C39A /* TDFAppDelegate.h */, 149 | 6003F59D195388D20070C39A /* TDFAppDelegate.m */, 150 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 151 | 6003F5A5195388D20070C39A /* TDFViewController.h */, 152 | 6003F5A6195388D20070C39A /* TDFViewController.m */, 153 | D63BB1B51F9E1FC600574241 /* TDFAModule.h */, 154 | D63BB1B61F9E1FC600574241 /* TDFAModule.m */, 155 | D63BB1B81F9E1FCF00574241 /* TDFBModule.h */, 156 | D63BB1B91F9E1FCF00574241 /* TDFBModule.m */, 157 | D626DFA11F9EE341008CF95E /* TDFCModule.h */, 158 | D626DFA21F9EE341008CF95E /* TDFCModule.m */, 159 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 160 | 6003F5A8195388D20070C39A /* Images.xcassets */, 161 | 6003F594195388D20070C39A /* Supporting Files */, 162 | ); 163 | name = "Example for TDFModuleKit"; 164 | path = TDFModuleKit; 165 | sourceTree = ""; 166 | }; 167 | 6003F594195388D20070C39A /* Supporting Files */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | 6003F595195388D20070C39A /* TDFModuleKit-Info.plist */, 171 | 6003F596195388D20070C39A /* InfoPlist.strings */, 172 | 6003F599195388D20070C39A /* main.m */, 173 | 6003F59B195388D20070C39A /* TDFModuleKit-Prefix.pch */, 174 | ); 175 | name = "Supporting Files"; 176 | sourceTree = ""; 177 | }; 178 | 6003F5B5195388D20070C39A /* Tests */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 6003F5BB195388D20070C39A /* Tests.m */, 182 | 6003F5B6195388D20070C39A /* Supporting Files */, 183 | ); 184 | path = Tests; 185 | sourceTree = ""; 186 | }; 187 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 191 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 192 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 193 | ); 194 | name = "Supporting Files"; 195 | sourceTree = ""; 196 | }; 197 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 198 | isa = PBXGroup; 199 | children = ( 200 | BBF100DBAF5190614B5073B6 /* TDFModuleKit.podspec */, 201 | 3CB843AF5B0A691E08D8B9F8 /* README.md */, 202 | 3036DE8576E1022CEEBF9B1A /* LICENSE */, 203 | ); 204 | name = "Podspec Metadata"; 205 | sourceTree = ""; 206 | }; 207 | 818F137A8DB46C0FA0037574 /* Pods */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | 1268AF3BB9DDF999003C04E0 /* Pods-TDFModuleKit_Example.debug.xcconfig */, 211 | 51B4B582F916973FC3EB2F9E /* Pods-TDFModuleKit_Example.release.xcconfig */, 212 | 9A594D8EFD47ED7AD40F1349 /* Pods-TDFModuleKit_Tests.debug.xcconfig */, 213 | 0941E41C9E7AD90163929A2F /* Pods-TDFModuleKit_Tests.release.xcconfig */, 214 | ); 215 | name = Pods; 216 | sourceTree = ""; 217 | }; 218 | /* End PBXGroup section */ 219 | 220 | /* Begin PBXNativeTarget section */ 221 | 6003F589195388D20070C39A /* TDFModuleKit_Example */ = { 222 | isa = PBXNativeTarget; 223 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "TDFModuleKit_Example" */; 224 | buildPhases = ( 225 | D33E4829CF8F30D9AD24A00E /* [CP] Check Pods Manifest.lock */, 226 | 6003F586195388D20070C39A /* Sources */, 227 | 6003F587195388D20070C39A /* Frameworks */, 228 | 6003F588195388D20070C39A /* Resources */, 229 | DD1FF4EB1890935E25D40A85 /* [CP] Embed Pods Frameworks */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | ); 235 | name = TDFModuleKit_Example; 236 | productName = TDFModuleKit; 237 | productReference = 6003F58A195388D20070C39A /* TDFModuleKit_Example.app */; 238 | productType = "com.apple.product-type.application"; 239 | }; 240 | 6003F5AD195388D20070C39A /* TDFModuleKit_Tests */ = { 241 | isa = PBXNativeTarget; 242 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "TDFModuleKit_Tests" */; 243 | buildPhases = ( 244 | 69D844553BD1B27BB7206E45 /* [CP] Check Pods Manifest.lock */, 245 | 6003F5AA195388D20070C39A /* Sources */, 246 | 6003F5AB195388D20070C39A /* Frameworks */, 247 | 6003F5AC195388D20070C39A /* Resources */, 248 | ); 249 | buildRules = ( 250 | ); 251 | dependencies = ( 252 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 253 | ); 254 | name = TDFModuleKit_Tests; 255 | productName = TDFModuleKitTests; 256 | productReference = 6003F5AE195388D20070C39A /* TDFModuleKit_Tests.xctest */; 257 | productType = "com.apple.product-type.bundle.unit-test"; 258 | }; 259 | /* End PBXNativeTarget section */ 260 | 261 | /* Begin PBXProject section */ 262 | 6003F582195388D10070C39A /* Project object */ = { 263 | isa = PBXProject; 264 | attributes = { 265 | CLASSPREFIX = TDF; 266 | LastUpgradeCheck = 0900; 267 | ORGANIZATIONNAME = tripleCC; 268 | TargetAttributes = { 269 | 6003F5AD195388D20070C39A = { 270 | TestTargetID = 6003F589195388D20070C39A; 271 | }; 272 | }; 273 | }; 274 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "TDFModuleKit" */; 275 | compatibilityVersion = "Xcode 3.2"; 276 | developmentRegion = English; 277 | hasScannedForEncodings = 0; 278 | knownRegions = ( 279 | en, 280 | Base, 281 | ); 282 | mainGroup = 6003F581195388D10070C39A; 283 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 284 | projectDirPath = ""; 285 | projectRoot = ""; 286 | targets = ( 287 | 6003F589195388D20070C39A /* TDFModuleKit_Example */, 288 | 6003F5AD195388D20070C39A /* TDFModuleKit_Tests */, 289 | ); 290 | }; 291 | /* End PBXProject section */ 292 | 293 | /* Begin PBXResourcesBuildPhase section */ 294 | 6003F588195388D20070C39A /* Resources */ = { 295 | isa = PBXResourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 299 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 300 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 301 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 6003F5AC195388D20070C39A /* Resources */ = { 306 | isa = PBXResourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXResourcesBuildPhase section */ 314 | 315 | /* Begin PBXShellScriptBuildPhase section */ 316 | 69D844553BD1B27BB7206E45 /* [CP] Check Pods Manifest.lock */ = { 317 | isa = PBXShellScriptBuildPhase; 318 | buildActionMask = 2147483647; 319 | files = ( 320 | ); 321 | inputPaths = ( 322 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 323 | "${PODS_ROOT}/Manifest.lock", 324 | ); 325 | name = "[CP] Check Pods Manifest.lock"; 326 | outputPaths = ( 327 | "$(DERIVED_FILE_DIR)/Pods-TDFModuleKit_Tests-checkManifestLockResult.txt", 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | shellPath = /bin/sh; 331 | 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"; 332 | showEnvVarsInLog = 0; 333 | }; 334 | D33E4829CF8F30D9AD24A00E /* [CP] Check Pods Manifest.lock */ = { 335 | isa = PBXShellScriptBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | ); 339 | inputPaths = ( 340 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 341 | "${PODS_ROOT}/Manifest.lock", 342 | ); 343 | name = "[CP] Check Pods Manifest.lock"; 344 | outputPaths = ( 345 | "$(DERIVED_FILE_DIR)/Pods-TDFModuleKit_Example-checkManifestLockResult.txt", 346 | ); 347 | runOnlyForDeploymentPostprocessing = 0; 348 | shellPath = /bin/sh; 349 | 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"; 350 | showEnvVarsInLog = 0; 351 | }; 352 | DD1FF4EB1890935E25D40A85 /* [CP] Embed Pods Frameworks */ = { 353 | isa = PBXShellScriptBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | ); 357 | inputPaths = ( 358 | "${SRCROOT}/Pods/Target Support Files/Pods-TDFModuleKit_Example/Pods-TDFModuleKit_Example-frameworks.sh", 359 | "${BUILT_PRODUCTS_DIR}/TDFModuleKit/TDFModuleKit.framework", 360 | ); 361 | name = "[CP] Embed Pods Frameworks"; 362 | outputPaths = ( 363 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TDFModuleKit.framework", 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | shellPath = /bin/sh; 367 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TDFModuleKit_Example/Pods-TDFModuleKit_Example-frameworks.sh\"\n"; 368 | showEnvVarsInLog = 0; 369 | }; 370 | /* End PBXShellScriptBuildPhase section */ 371 | 372 | /* Begin PBXSourcesBuildPhase section */ 373 | 6003F586195388D20070C39A /* Sources */ = { 374 | isa = PBXSourcesBuildPhase; 375 | buildActionMask = 2147483647; 376 | files = ( 377 | D626DFA31F9EE341008CF95E /* TDFCModule.m in Sources */, 378 | D63BB1BA1F9E1FCF00574241 /* TDFBModule.m in Sources */, 379 | D63BB1B71F9E1FC600574241 /* TDFAModule.m in Sources */, 380 | 6003F59E195388D20070C39A /* TDFAppDelegate.m in Sources */, 381 | 6003F5A7195388D20070C39A /* TDFViewController.m in Sources */, 382 | 6003F59A195388D20070C39A /* main.m in Sources */, 383 | ); 384 | runOnlyForDeploymentPostprocessing = 0; 385 | }; 386 | 6003F5AA195388D20070C39A /* Sources */ = { 387 | isa = PBXSourcesBuildPhase; 388 | buildActionMask = 2147483647; 389 | files = ( 390 | BE72711B209468F900E406C1 /* TDFAppDelegate.m in Sources */, 391 | BE727118209468F500E406C1 /* TDFAModule.m in Sources */, 392 | BE727119209468F500E406C1 /* TDFBModule.m in Sources */, 393 | BE72711A209468F500E406C1 /* TDFCModule.m in Sources */, 394 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 395 | ); 396 | runOnlyForDeploymentPostprocessing = 0; 397 | }; 398 | /* End PBXSourcesBuildPhase section */ 399 | 400 | /* Begin PBXTargetDependency section */ 401 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 402 | isa = PBXTargetDependency; 403 | target = 6003F589195388D20070C39A /* TDFModuleKit_Example */; 404 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 405 | }; 406 | /* End PBXTargetDependency section */ 407 | 408 | /* Begin PBXVariantGroup section */ 409 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 410 | isa = PBXVariantGroup; 411 | children = ( 412 | 6003F597195388D20070C39A /* en */, 413 | ); 414 | name = InfoPlist.strings; 415 | sourceTree = ""; 416 | }; 417 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 418 | isa = PBXVariantGroup; 419 | children = ( 420 | 6003F5B9195388D20070C39A /* en */, 421 | ); 422 | name = InfoPlist.strings; 423 | sourceTree = ""; 424 | }; 425 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { 426 | isa = PBXVariantGroup; 427 | children = ( 428 | 71719F9E1E33DC2100824A3D /* Base */, 429 | ); 430 | name = LaunchScreen.storyboard; 431 | sourceTree = ""; 432 | }; 433 | /* End PBXVariantGroup section */ 434 | 435 | /* Begin XCBuildConfiguration section */ 436 | 6003F5BD195388D20070C39A /* Debug */ = { 437 | isa = XCBuildConfiguration; 438 | buildSettings = { 439 | ALWAYS_SEARCH_USER_PATHS = NO; 440 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 441 | CLANG_CXX_LIBRARY = "libc++"; 442 | CLANG_ENABLE_MODULES = YES; 443 | CLANG_ENABLE_OBJC_ARC = YES; 444 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 445 | CLANG_WARN_BOOL_CONVERSION = YES; 446 | CLANG_WARN_COMMA = YES; 447 | CLANG_WARN_CONSTANT_CONVERSION = YES; 448 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 449 | CLANG_WARN_EMPTY_BODY = YES; 450 | CLANG_WARN_ENUM_CONVERSION = YES; 451 | CLANG_WARN_INFINITE_RECURSION = YES; 452 | CLANG_WARN_INT_CONVERSION = YES; 453 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 455 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 456 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 457 | CLANG_WARN_STRICT_PROTOTYPES = YES; 458 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 459 | CLANG_WARN_UNREACHABLE_CODE = YES; 460 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 461 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 462 | COPY_PHASE_STRIP = NO; 463 | ENABLE_STRICT_OBJC_MSGSEND = YES; 464 | ENABLE_TESTABILITY = YES; 465 | GCC_C_LANGUAGE_STANDARD = gnu99; 466 | GCC_DYNAMIC_NO_PIC = NO; 467 | GCC_NO_COMMON_BLOCKS = YES; 468 | GCC_OPTIMIZATION_LEVEL = 0; 469 | GCC_PREPROCESSOR_DEFINITIONS = ( 470 | "DEBUG=1", 471 | "$(inherited)", 472 | ); 473 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 476 | GCC_WARN_UNDECLARED_SELECTOR = YES; 477 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 478 | GCC_WARN_UNUSED_FUNCTION = YES; 479 | GCC_WARN_UNUSED_VARIABLE = YES; 480 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 481 | ONLY_ACTIVE_ARCH = YES; 482 | SDKROOT = iphoneos; 483 | TARGETED_DEVICE_FAMILY = "1,2"; 484 | }; 485 | name = Debug; 486 | }; 487 | 6003F5BE195388D20070C39A /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | ALWAYS_SEARCH_USER_PATHS = NO; 491 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 492 | CLANG_CXX_LIBRARY = "libc++"; 493 | CLANG_ENABLE_MODULES = YES; 494 | CLANG_ENABLE_OBJC_ARC = YES; 495 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 496 | CLANG_WARN_BOOL_CONVERSION = YES; 497 | CLANG_WARN_COMMA = YES; 498 | CLANG_WARN_CONSTANT_CONVERSION = YES; 499 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 500 | CLANG_WARN_EMPTY_BODY = YES; 501 | CLANG_WARN_ENUM_CONVERSION = YES; 502 | CLANG_WARN_INFINITE_RECURSION = YES; 503 | CLANG_WARN_INT_CONVERSION = YES; 504 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 505 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 506 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 507 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 508 | CLANG_WARN_STRICT_PROTOTYPES = YES; 509 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 510 | CLANG_WARN_UNREACHABLE_CODE = YES; 511 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 512 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 513 | COPY_PHASE_STRIP = YES; 514 | ENABLE_NS_ASSERTIONS = NO; 515 | ENABLE_STRICT_OBJC_MSGSEND = YES; 516 | GCC_C_LANGUAGE_STANDARD = gnu99; 517 | GCC_NO_COMMON_BLOCKS = YES; 518 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 519 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 520 | GCC_WARN_UNDECLARED_SELECTOR = YES; 521 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 522 | GCC_WARN_UNUSED_FUNCTION = YES; 523 | GCC_WARN_UNUSED_VARIABLE = YES; 524 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 525 | SDKROOT = iphoneos; 526 | TARGETED_DEVICE_FAMILY = "1,2"; 527 | VALIDATE_PRODUCT = YES; 528 | }; 529 | name = Release; 530 | }; 531 | 6003F5C0195388D20070C39A /* Debug */ = { 532 | isa = XCBuildConfiguration; 533 | baseConfigurationReference = 1268AF3BB9DDF999003C04E0 /* Pods-TDFModuleKit_Example.debug.xcconfig */; 534 | buildSettings = { 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 536 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 537 | GCC_PREFIX_HEADER = "TDFModuleKit/TDFModuleKit-Prefix.pch"; 538 | INFOPLIST_FILE = "TDFModuleKit/TDFModuleKit-Info.plist"; 539 | MODULE_NAME = ExampleApp; 540 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 541 | PRODUCT_NAME = "$(TARGET_NAME)"; 542 | WRAPPER_EXTENSION = app; 543 | }; 544 | name = Debug; 545 | }; 546 | 6003F5C1195388D20070C39A /* Release */ = { 547 | isa = XCBuildConfiguration; 548 | baseConfigurationReference = 51B4B582F916973FC3EB2F9E /* Pods-TDFModuleKit_Example.release.xcconfig */; 549 | buildSettings = { 550 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 551 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 552 | GCC_PREFIX_HEADER = "TDFModuleKit/TDFModuleKit-Prefix.pch"; 553 | INFOPLIST_FILE = "TDFModuleKit/TDFModuleKit-Info.plist"; 554 | MODULE_NAME = ExampleApp; 555 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 556 | PRODUCT_NAME = "$(TARGET_NAME)"; 557 | WRAPPER_EXTENSION = app; 558 | }; 559 | name = Release; 560 | }; 561 | 6003F5C3195388D20070C39A /* Debug */ = { 562 | isa = XCBuildConfiguration; 563 | baseConfigurationReference = 9A594D8EFD47ED7AD40F1349 /* Pods-TDFModuleKit_Tests.debug.xcconfig */; 564 | buildSettings = { 565 | BUNDLE_LOADER = "$(TEST_HOST)"; 566 | FRAMEWORK_SEARCH_PATHS = ( 567 | "$(SDKROOT)/Developer/Library/Frameworks", 568 | "$(inherited)", 569 | "$(DEVELOPER_FRAMEWORKS_DIR)", 570 | ); 571 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 572 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 573 | GCC_PREPROCESSOR_DEFINITIONS = ( 574 | "DEBUG=1", 575 | "$(inherited)", 576 | ); 577 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 578 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 579 | PRODUCT_NAME = "$(TARGET_NAME)"; 580 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TDFModuleKit_Example.app/TDFModuleKit_Example"; 581 | WRAPPER_EXTENSION = xctest; 582 | }; 583 | name = Debug; 584 | }; 585 | 6003F5C4195388D20070C39A /* Release */ = { 586 | isa = XCBuildConfiguration; 587 | baseConfigurationReference = 0941E41C9E7AD90163929A2F /* Pods-TDFModuleKit_Tests.release.xcconfig */; 588 | buildSettings = { 589 | BUNDLE_LOADER = "$(TEST_HOST)"; 590 | FRAMEWORK_SEARCH_PATHS = ( 591 | "$(SDKROOT)/Developer/Library/Frameworks", 592 | "$(inherited)", 593 | "$(DEVELOPER_FRAMEWORKS_DIR)", 594 | ); 595 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 596 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 597 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 598 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 599 | PRODUCT_NAME = "$(TARGET_NAME)"; 600 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TDFModuleKit_Example.app/TDFModuleKit_Example"; 601 | WRAPPER_EXTENSION = xctest; 602 | }; 603 | name = Release; 604 | }; 605 | /* End XCBuildConfiguration section */ 606 | 607 | /* Begin XCConfigurationList section */ 608 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "TDFModuleKit" */ = { 609 | isa = XCConfigurationList; 610 | buildConfigurations = ( 611 | 6003F5BD195388D20070C39A /* Debug */, 612 | 6003F5BE195388D20070C39A /* Release */, 613 | ); 614 | defaultConfigurationIsVisible = 0; 615 | defaultConfigurationName = Release; 616 | }; 617 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "TDFModuleKit_Example" */ = { 618 | isa = XCConfigurationList; 619 | buildConfigurations = ( 620 | 6003F5C0195388D20070C39A /* Debug */, 621 | 6003F5C1195388D20070C39A /* Release */, 622 | ); 623 | defaultConfigurationIsVisible = 0; 624 | defaultConfigurationName = Release; 625 | }; 626 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "TDFModuleKit_Tests" */ = { 627 | isa = XCConfigurationList; 628 | buildConfigurations = ( 629 | 6003F5C3195388D20070C39A /* Debug */, 630 | 6003F5C4195388D20070C39A /* Release */, 631 | ); 632 | defaultConfigurationIsVisible = 0; 633 | defaultConfigurationName = Release; 634 | }; 635 | /* End XCConfigurationList section */ 636 | }; 637 | rootObject = 6003F582195388D10070C39A /* Project object */; 638 | } 639 | -------------------------------------------------------------------------------- /Example/TDFModuleKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/TDFModuleKit.xcodeproj/xcshareddata/xcschemes/TDFModuleKit-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 66 | 68 | 74 | 75 | 76 | 77 | 78 | 79 | 85 | 87 | 93 | 94 | 95 | 96 | 98 | 99 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Example/TDFModuleKit.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/TDFModuleKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/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 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/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 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFAModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFAModule.h 3 | // TDFModuleKit_Example 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // Copyright © 2017年 tripleCC. All rights reserved. 7 | // 8 | 9 | #import "TDFModuleKit.h" 10 | 11 | @interface TDFAModule : TDFModule 12 | @end 13 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFAModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFAModule.m 3 | // TDFModuleKit_Example 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // Copyright © 2017年 tripleCC. All rights reserved. 7 | // 8 | 9 | #import "TDFAModule.h" 10 | 11 | @implementation TDFAModule 12 | + (void)load { 13 | [self registerModule]; 14 | } 15 | 16 | + (TDFModulePriority)priority { 17 | return TDFModulePriorityHigh; 18 | } 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 22 | [self runAfterMethodExecuted:^{ 23 | NSLog(@"runAfterMethodExecuted %@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 24 | }]; 25 | return YES; 26 | } 27 | 28 | - (void)applicationWillEnterForeground:(UIApplication *)application { 29 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 30 | } 31 | 32 | - (void)applicationDidBecomeActive:(UIApplication *)application { 33 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 34 | } 35 | 36 | - (void)applicationWillTerminate:(UIApplication *)application { 37 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 38 | } 39 | 40 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 41 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 42 | return NO; 43 | } 44 | 45 | - (BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(UIApplicationExtensionPointIdentifier)extensionPointIdentifier { 46 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 47 | 48 | return NO; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFAppDelegate.h 3 | // TDFModuleKit 4 | // 5 | // Created by tripleCC on 10/23/2017. 6 | // Copyright (c) 2017 tripleCC. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface TDFAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFAppDelegate.m 3 | // TDFModuleKit 4 | // 5 | // Created by tripleCC on 10/23/2017. 6 | // Copyright (c) 2017 tripleCC. All rights reserved. 7 | // 8 | 9 | #import "TDFAppDelegate.h" 10 | #import "TDFViewController.h" 11 | 12 | @implementation TDFAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | // Override point for customization after application launch. 17 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 18 | 19 | UIWindow *w = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 20 | w.rootViewController = [[TDFViewController alloc] init]; 21 | [w makeKeyAndVisible]; 22 | 23 | return YES; 24 | } 25 | 26 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 27 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 28 | return NO; 29 | } 30 | 31 | - (BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(UIApplicationExtensionPointIdentifier)extensionPointIdentifier { 32 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 33 | return NO; 34 | } 35 | 36 | 37 | - (void)applicationWillResignActive:(UIApplication *)application 38 | { 39 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 40 | // 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. 41 | // 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. 42 | } 43 | 44 | - (void)applicationDidEnterBackground:(UIApplication *)application 45 | { 46 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 47 | // 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. 48 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | } 50 | 51 | - (void)applicationWillTerminate:(UIApplication *)application 52 | { 53 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 54 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFBModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFBModule.h 3 | // TDFModuleKit_Example 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // Copyright © 2017年 tripleCC. All rights reserved. 7 | // 8 | 9 | #import "TDFModuleKit.h" 10 | 11 | @interface TDFBModule : TDFModule 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFBModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFBModule.m 3 | // TDFModuleKit_Example 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // Copyright © 2017年 tripleCC. All rights reserved. 7 | // 8 | 9 | #import "TDFBModule.h" 10 | 11 | @implementation TDFBModule 12 | + (void)load { 13 | [self registerModule]; 14 | } 15 | 16 | - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions { 17 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 18 | return YES; 19 | } 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 23 | return YES; 24 | } 25 | 26 | - (BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(UIApplicationExtensionPointIdentifier)extensionPointIdentifier { 27 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 28 | return NO; 29 | } 30 | 31 | 32 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 33 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 34 | return NO; 35 | } 36 | 37 | 38 | - (void)applicationWillEnterForeground:(UIApplication *)application 39 | { 40 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 41 | // 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. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application 45 | { 46 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 47 | // 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. 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFCModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFCModule.h 3 | // TDFModuleKit_Example 4 | // 5 | // Created by tripleCC on 2017/10/24. 6 | // Copyright © 2017年 tripleCC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TDFCModule : TDFModule 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFCModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFCModule.m 3 | // TDFModuleKit_Example 4 | // 5 | // Created by tripleCC on 2017/10/24. 6 | // Copyright © 2017年 tripleCC. All rights reserved. 7 | // 8 | 9 | #import "TDFCModule.h" 10 | 11 | @implementation TDFCModule 12 | + (void)load { 13 | [self registerModule]; 14 | } 15 | 16 | + (TDFModulePriority)priority { 17 | return TDFModulePriorityLow; 18 | } 19 | 20 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 21 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 22 | 23 | if ([url.scheme isEqualToString:@"http"]) { 24 | return YES; 25 | } 26 | 27 | return NO; 28 | } 29 | 30 | - (BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(UIApplicationExtensionPointIdentifier)extensionPointIdentifier { 31 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 32 | return NO; 33 | } 34 | 35 | - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions { 36 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 37 | return YES; 38 | } 39 | 40 | - (void)applicationWillEnterForeground:(UIApplication *)application 41 | { 42 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 43 | // 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. 44 | } 45 | 46 | - (void)applicationDidBecomeActive:(UIApplication *)application 47 | { 48 | NSLog(@"%@, %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); 49 | // 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. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFModuleKit-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 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFModuleKit-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFViewController.h 3 | // TDFModuleKit 4 | // 5 | // Created by tripleCC on 10/23/2017. 6 | // Copyright (c) 2017 tripleCC. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface TDFViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/TDFViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFViewController.m 3 | // TDFModuleKit 4 | // 5 | // Created by tripleCC on 10/23/2017. 6 | // Copyright (c) 2017 tripleCC. All rights reserved. 7 | // 8 | 9 | #import "TDFViewController.h" 10 | 11 | @interface TDFViewController () 12 | 13 | @end 14 | 15 | @implementation TDFViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | NSLog(@"resultA %d", [[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"ftp://ggboy"] options:@{}]); 21 | NSLog(@"resultB %d", [[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://ggboy"] options:@{}]); 22 | 23 | NSLog(@"resultC %d", [[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] shouldAllowExtensionPointIdentifier:@"LALALA"]); 24 | // Do any additional setup after loading the view, typically from a nib. 25 | } 26 | 27 | - (void)didReceiveMemoryWarning 28 | { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/TDFModuleKit/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TDFModuleKit 4 | // 5 | // Created by tripleCC on 10/23/2017. 6 | // Copyright (c) 2017 tripleCC. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "TDFAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([TDFAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFModuleKitTests.m 3 | // TDFModuleKitTests 4 | // 5 | // Created by tripleCC on 10/23/2017. 6 | // Copyright (c) 2017 tripleCC. All rights reserved. 7 | // 8 | @import UIKit; 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample 29 | { 30 | 31 | } 32 | 33 | - (void)test_boolReturnValue { 34 | XCTAssertTrue([[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://ggboy"] options:@{}]); 35 | XCTAssertFalse([[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"ftp://ggboy"] options:@{}]); 36 | XCTAssertFalse([[UIApplication sharedApplication].delegate application:[UIApplication sharedApplication] shouldAllowExtensionPointIdentifier:@"LALALA"]); 37 | } 38 | 39 | @end 40 | 41 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 tripleCC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TDFModuleKit 2 | 3 | [![CI Status](http://img.shields.io/travis/tripleCC/TDFModuleKit.svg?style=flat)](https://travis-ci.org/tripleCC/TDFModuleKit) 4 | [![Version](https://img.shields.io/cocoapods/v/TDFModuleKit.svg?style=flat)](http://cocoapods.org/pods/TDFModuleKit) 5 | [![License](https://img.shields.io/cocoapods/l/TDFModuleKit.svg?style=flat)](http://cocoapods.org/pods/TDFModuleKit) 6 | [![Platform](https://img.shields.io/cocoapods/p/TDFModuleKit.svg?style=flat)](http://cocoapods.org/pods/TDFModuleKit) 7 | 8 | 相关博客: [组件化之组件生命周期管理](https://triplecc.github.io/2017/10/25/2017-10-25-zu-jian-sheng-ming-zhou-qi/) 9 | 10 | ## Example 11 | 12 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 13 | 14 | ## Requirements 15 | 16 | ## Installation 17 | 18 | TDFModuleKit is available through [CocoaPods](http://cocoapods.org). To install 19 | it, simply add the following line to your Podfile: 20 | 21 | ```ruby 22 | pod 'TDFModuleKit' 23 | ``` 24 | 25 | ## Author 26 | 27 | tripleCC, triplec.linux@gmail.com 28 | 29 | ## License 30 | 31 | TDFModuleKit is available under the MIT license. See the LICENSE file for more info. 32 | -------------------------------------------------------------------------------- /TDFModuleKit.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint TDFModuleKit.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'TDFModuleKit' 11 | 12 | s.version = "1.0.6" 13 | s.summary = 'TDFModuleKit 模块抽象类,可以提供模块生命周期回调.' 14 | 15 | # This description is used to generate tags and improve search results. 16 | # * Think: What does it do? Why did you write it? What is the focus? 17 | # * Try to keep it short, snappy and to the point. 18 | # * Write the description between the DESC delimiters below. 19 | # * Finally, don't worry about the indent, CocoaPods strips it! 20 | 21 | s.description = <<-DESC 22 | TDFModuleKit 模块抽象类,可以提供模块生命周期回调,无感知集成模块. 23 | DESC 24 | 25 | s.homepage = 'https://github.com/tripleCC/TDFModuleKit' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'tripleCC' => 'triplec.linux@gmail.com' } 28 | s.source = { :git => 'https://github.com/DManager/TDFModuleKit.git', :tag => s.version.to_s } 29 | s.ios.deployment_target = '8.0' 30 | 31 | s.source_files = 'TDFModuleKit/Classes/**/*' 32 | s.public_header_files = ['TDFModuleKit/Classes/TDFModuleKit.h', 'TDFModuleKit/Classes/TDFModule.h'] 33 | end 34 | -------------------------------------------------------------------------------- /TDFModuleKit/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DManager/TDFModuleKit/7723f022edcb74a6339a9dbfe9dc87c6f8c14cca/TDFModuleKit/Assets/.gitkeep -------------------------------------------------------------------------------- /TDFModuleKit/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DManager/TDFModuleKit/7723f022edcb74a6339a9dbfe9dc87c6f8c14cca/TDFModuleKit/Classes/.gitkeep -------------------------------------------------------------------------------- /TDFModuleKit/Classes/TDFApplicationDelegateProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFApplicationDelegateProxy.h 3 | // Aspects 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // 7 | 8 | @import UIKit; 9 | 10 | @interface TDFApplicationDelegateProxy : NSObject 11 | @property (strong, nonatomic) id realDelegate; 12 | @end 13 | -------------------------------------------------------------------------------- /TDFModuleKit/Classes/TDFApplicationDelegateProxy.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFApplicationDelegateProxy.m 3 | // Aspects 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // 7 | @import ObjectiveC.runtime; 8 | @import UIKit; 9 | 10 | #import "TDFModule.h" 11 | #import "TDFModuleManager.h" 12 | #import "TDFApplicationDelegateProxy.h" 13 | 14 | @implementation TDFApplicationDelegateProxy 15 | - (Protocol *)targetProtocol { 16 | return @protocol(UIApplicationDelegate); 17 | } 18 | 19 | - (BOOL)isTargetProtocolMethod:(SEL)selector { 20 | unsigned int outCount = 0; 21 | struct objc_method_description *methodDescriptions = protocol_copyMethodDescriptionList([self targetProtocol], NO, YES, &outCount); 22 | 23 | for (int idx = 0; idx < outCount; idx++) { 24 | if (selector == methodDescriptions[idx].name) { 25 | free(methodDescriptions); 26 | 27 | return YES; 28 | } 29 | } 30 | free(methodDescriptions); 31 | 32 | return NO; 33 | } 34 | 35 | - (BOOL)respondsToSelector:(SEL)aSelector { 36 | if ([self.realDelegate respondsToSelector:aSelector]) { 37 | return YES; 38 | } 39 | 40 | for (TDFModule *module in [TDFModuleManager shared].modules) { 41 | if ([self isTargetProtocolMethod:aSelector] && [module respondsToSelector:aSelector]) { 42 | return YES; 43 | } 44 | } 45 | 46 | return [super respondsToSelector:aSelector]; 47 | } 48 | 49 | - (id)forwardingTargetForSelector:(SEL)aSelector { 50 | if (![self isTargetProtocolMethod:aSelector] && [self.realDelegate respondsToSelector:aSelector]) { 51 | return self.realDelegate; 52 | } 53 | return self; 54 | } 55 | 56 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 57 | struct objc_method_description methodDescription = protocol_getMethodDescription([self targetProtocol], aSelector, NO, YES); 58 | 59 | if (methodDescription.name == NULL && methodDescription.types == NULL) { 60 | return [[self class] instanceMethodSignatureForSelector:@selector(doNothing)]; 61 | } 62 | 63 | return [NSMethodSignature signatureWithObjCTypes:methodDescription.types];; 64 | } 65 | 66 | - (void)forwardInvocation:(NSInvocation *)anInvocation { 67 | NSMutableArray *allModules = [NSMutableArray arrayWithObjects:self.realDelegate, nil]; 68 | [allModules addObjectsFromArray:[TDFModuleManager shared].modules]; 69 | 70 | // BOOL 型返回值做特殊 | 处理 71 | if (anInvocation.methodSignature.methodReturnType[0] == 'B') { 72 | BOOL realReturnValue = NO; 73 | 74 | for (TDFModule *module in allModules) { 75 | if ([module respondsToSelector:anInvocation.selector]) { 76 | [anInvocation invokeWithTarget:module]; 77 | 78 | BOOL returnValue = NO; 79 | [anInvocation getReturnValue:&returnValue]; 80 | 81 | realReturnValue = returnValue || realReturnValue; 82 | } 83 | } 84 | 85 | [anInvocation setReturnValue:&realReturnValue]; 86 | } else { 87 | for (TDFModule *module in allModules) { 88 | if ([module respondsToSelector:anInvocation.selector]) { 89 | [anInvocation invokeWithTarget:module]; 90 | } 91 | } 92 | } 93 | } 94 | 95 | - (void)doNothing {} 96 | @end 97 | -------------------------------------------------------------------------------- /TDFModuleKit/Classes/TDFModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFModule.h 3 | // Aspects 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // 7 | @import UIKit; 8 | 9 | 10 | /** 11 | 模块子类必须遵守此协议 12 | */ 13 | @protocol TDFModuleProtocol 14 | @end 15 | 16 | /** 17 | 模块优先级 18 | 19 | - TDFModulePriorityVeryLow: 极底 20 | - TDFModulePriorityLow: 低 21 | 安排给弱业务,业务模块 22 | 23 | - TDFModulePriorityMedium: 中 24 | - TDFModulePriorityHigh: 高 25 | - TDFModulePriorityVeryHigh: 极高 26 | 安排给基础模块(有些基础模块每次依赖都需要手动调用初始化方法,建议分成 Core / Initializer subspec,后者中只有一个类继承TDFModule,这样直接依赖模块时,初始化代码的编写就可以去掉了) 27 | 这种情况下,TDFModule子类中,最好不要存在硬编码,使用变量或配置文件配置,这样才能让各业务线通用 28 | */ 29 | typedef NS_ENUM(NSInteger, TDFModulePriority) { 30 | TDFModulePriorityVeryLow = 25, 31 | TDFModulePriorityLow = 50, 32 | TDFModulePriorityMedium = 100, 33 | TDFModulePriorityHigh = 150, 34 | TDFModulePriorityVeryHigh = 175, 35 | }; 36 | 37 | @interface TDFModule : NSObject 38 | + (instancetype)module; 39 | 40 | /** 41 | 在 load 中调用,以注册模块 42 | */ 43 | + (void)registerModule; 44 | 45 | /** 46 | 模块优先级 47 | 48 | 主工程模块的调用最先进行,剩余附属模块, 49 | 内部会根据优先级,依次调用 UIApplicationDelegate 代理 50 | 默认是 TDFModulePriorityMedium 51 | 52 | @return 优先级 53 | */ 54 | + (TDFModulePriority)priority; 55 | 56 | /** 57 | 在调用方法执行完成之后执行 block 58 | 59 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 60 | [self runAfterMethodExecuted:^{ 61 | // 创建 windows 62 | }]; 63 | return YES; 64 | } 65 | 66 | 某些操作只能在系统声明周期执行完成之后才执行,比如创建 level 比较高的 window,需要设置 root vc,(可能会和原 root vc 冲突) 67 | 这时候就需要将操作放入下面 block 中 68 | 69 | 推荐对顺序不敏感,对系统调用返回值不影响的操作都放在这个方法的 block 参数中 70 | */ 71 | - (void)runAfterMethodExecuted:(void(^)(void))block; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /TDFModuleKit/Classes/TDFModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFModule.m 3 | // Aspects 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // 7 | 8 | #import "TDFModule.h" 9 | #import "TDFModuleManager.h" 10 | 11 | @implementation TDFModule 12 | - (instancetype)init { 13 | if (self = [super init]) { 14 | if (![self conformsToProtocol:@protocol(TDFModuleProtocol)]) { 15 | @throw [NSException exceptionWithName:@"TDFModuleRegisterProgress" reason:@"subclass should confirm to ." userInfo:nil]; 16 | } 17 | } 18 | 19 | return self; 20 | } 21 | 22 | + (instancetype)module { 23 | return [[self alloc] init]; 24 | } 25 | 26 | + (void)registerModule { 27 | // https://developer.apple.com/documentation/objectivec/nsobject/1418815-load?preferredLanguage=occ 28 | // In a custom implementation of load you can therefore safely message other unrelated classes from the same image, but any load methods implemented by those classes may not have run yet. 29 | // load 之前,同一个 image 中的所有 class 都是已知的,所以可以调用 30 | [TDFModuleManager addModuleClass:self]; 31 | } 32 | 33 | + (TDFModulePriority)priority { 34 | return TDFModulePriorityMedium; 35 | } 36 | 37 | - (void)runAfterMethodExecuted:(void (^)(void))block { 38 | // 当前代码执行完后,再执行 block 代码 39 | dispatch_async(dispatch_get_main_queue(), ^{ 40 | !block ?: block(); 41 | }); 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /TDFModuleKit/Classes/TDFModuleKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFModuleKit.h 3 | // Pods 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // 7 | 8 | #ifndef TDFModuleKit_h 9 | #define TDFModuleKit_h 10 | 11 | #import "TDFModule.h" 12 | 13 | #endif /* TDFModuleKit_h */ 14 | -------------------------------------------------------------------------------- /TDFModuleKit/Classes/TDFModuleManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // TDFModuleManager.h 3 | // Aspects 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // 7 | 8 | @import Foundation; 9 | 10 | @class TDFModule; 11 | @class TDFApplicationDelegateProxy; 12 | 13 | @interface TDFModuleManager : NSObject { 14 | @package 15 | TDFApplicationDelegateProxy *_proxy; 16 | } 17 | @property (strong, nonatomic, readonly) TDFApplicationDelegateProxy *proxy; 18 | @property (strong, nonatomic, readonly) NSArray *modules; 19 | 20 | + (instancetype)shared; 21 | + (void)addModuleClass:(Class)cls; 22 | + (void)removeModuleClass:(Class)cls; 23 | @end 24 | -------------------------------------------------------------------------------- /TDFModuleKit/Classes/TDFModuleManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // TDFModuleManager.m 3 | // Aspects 4 | // 5 | // Created by tripleCC on 2017/10/23. 6 | // 7 | @import ObjectiveC.runtime; 8 | @import UIKit; 9 | 10 | #import "TDFModuleManager.h" 11 | #import "TDFModule.h" 12 | #import "TDFApplicationDelegateProxy.h" 13 | 14 | static NSMutableArray const * TDFModuleClassArray = nil; 15 | 16 | @interface TDFModuleManager() 17 | @property (strong, nonatomic) NSMutableArray *mModules; 18 | @end 19 | 20 | @implementation TDFModuleManager 21 | + (instancetype)shared { 22 | static dispatch_once_t onceToken; 23 | static TDFModuleManager *singleton = nil; 24 | dispatch_once(&onceToken, ^{ 25 | singleton = [[self alloc] init]; 26 | }); 27 | return singleton; 28 | } 29 | 30 | + (void)addModuleClass:(Class)cls { 31 | NSParameterAssert(cls && [cls isSubclassOfClass:[TDFModule class]]); 32 | 33 | if (!TDFModuleClassArray) { 34 | TDFModuleClassArray = [NSMutableArray array]; 35 | } 36 | 37 | if (![TDFModuleClassArray containsObject:cls]) { 38 | [TDFModuleClassArray addObject:cls]; 39 | } 40 | } 41 | 42 | + (void)removeModuleClass:(Class)cls { 43 | [TDFModuleClassArray removeObject:cls]; 44 | } 45 | 46 | - (void)generateRegistedModules { 47 | [self.mModules removeAllObjects]; 48 | 49 | [TDFModuleClassArray sortUsingDescriptors:@[[[NSSortDescriptor alloc] initWithKey:@"priority" ascending:NO]]]; 50 | 51 | for (Class cls in TDFModuleClassArray) { 52 | TDFModule *module = [cls module]; 53 | NSAssert(module, @"module can't be nil of class %@", NSStringFromClass(cls)); 54 | 55 | if (![self.mModules containsObject:module]) { 56 | [self.mModules addObject:module]; 57 | } 58 | } 59 | } 60 | 61 | - (TDFApplicationDelegateProxy *)proxy { 62 | if (!_proxy) { 63 | _proxy = [[TDFApplicationDelegateProxy alloc] init]; 64 | } 65 | 66 | return _proxy; 67 | } 68 | 69 | - (NSArray *)modules { 70 | return (NSArray *)self.mModules; 71 | } 72 | 73 | - (NSMutableArray *)mModules { 74 | if (!_mModules) { 75 | _mModules = [NSMutableArray array]; 76 | } 77 | 78 | return _mModules; 79 | } 80 | @end 81 | 82 | static void MCDSwizzleInstanceMethod(Class cls, SEL originalSelector, Class targetCls, SEL swizzledSelector) { 83 | Method originalMethod = class_getInstanceMethod(cls, originalSelector); 84 | Method swizzledMethod = class_getInstanceMethod(targetCls, swizzledSelector); 85 | BOOL didAddMethod = class_addMethod(cls, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); 86 | if (didAddMethod) { 87 | class_replaceMethod(cls, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 88 | } else { 89 | method_exchangeImplementations(originalMethod, swizzledMethod); 90 | } 91 | } 92 | 93 | @implementation UIApplication (TDFModule) 94 | + (void)load { 95 | static dispatch_once_t onceToken; 96 | dispatch_once(&onceToken, ^{ 97 | MCDSwizzleInstanceMethod(self, @selector(setDelegate:), self, @selector(mcd_setDelegate:)); 98 | }); 99 | } 100 | 101 | - (void)mcd_setDelegate:(id )delegate { 102 | TDFModuleManager.shared.proxy.realDelegate = delegate; 103 | [TDFModuleManager.shared generateRegistedModules]; 104 | 105 | [self mcd_setDelegate:(id )TDFModuleManager.shared.proxy]; 106 | } 107 | @end 108 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------