├── .gitignore ├── LICENSE ├── README.md ├── SilverMVC.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── SilverMVC.xcscmblueprint ├── SilverMVC ├── AppContext.swift ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ └── LaunchScreen.storyboard ├── DetailsViewController.swift ├── DetailsViewProtocol.swift ├── Info.plist ├── MainPresenter.swift ├── MainView.swift ├── MainViewProtocol.swift ├── NavigationPresenter.swift ├── NavigationViewProtocol.swift ├── ProductionContext.swift ├── Signal.swift ├── SilverMVC+UIKit.swift ├── TextLoader.swift ├── TextLoaderProtocol.swift ├── ViewProtocol.swift ├── WindowPresenter.swift └── WindowProtocol.swift └── SilverMVCTests ├── Info.plist ├── SilverMVCTests.swift ├── TestContext.swift └── TestRouting.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Pavel Sharanda 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SilverMVC 2 | In Search of the Silver Bullet: MVC 3 | -------------------------------------------------------------------------------- /SilverMVC.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1B158F6E1DDF21150069E60E /* Signal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B158F6D1DDF21150069E60E /* Signal.swift */; }; 11 | 1B4581121DE1DBDE003F96A2 /* ProductionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4581111DE1DBDE003F96A2 /* ProductionContext.swift */; }; 12 | 1B4581141DE1E47B003F96A2 /* ViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4581131DE1E47B003F96A2 /* ViewProtocol.swift */; }; 13 | 1B6050321DE201DE00B74DC3 /* ProductionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4581111DE1DBDE003F96A2 /* ProductionContext.swift */; }; 14 | 1B6050331DE201DE00B74DC3 /* ViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4581131DE1E47B003F96A2 /* ViewProtocol.swift */; }; 15 | 1B6050341DE201DE00B74DC3 /* MainViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B01DDE176C00D7DDAB /* MainViewProtocol.swift */; }; 16 | 1B6050351DE201DE00B74DC3 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815AC1DDE175700D7DDAB /* MainView.swift */; }; 17 | 1B6050361DE201DE00B74DC3 /* MainPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B41DDE185C00D7DDAB /* MainPresenter.swift */; }; 18 | 1B6050381DE201DE00B74DC3 /* Signal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B158F6D1DDF21150069E60E /* Signal.swift */; }; 19 | 1B6050391DE201DE00B74DC3 /* TextLoaderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BD88B561DDEF1780059E401 /* TextLoaderProtocol.swift */; }; 20 | 1B60503A1DE201DE00B74DC3 /* TextLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BD88B571DDEF1780059E401 /* TextLoader.swift */; }; 21 | 1B60503B1DE201DE00B74DC3 /* DetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B81DDE217F00D7DDAB /* DetailsViewController.swift */; }; 22 | 1B60503C1DE201DE00B74DC3 /* NavigationPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B61DDE1F7D00D7DDAB /* NavigationPresenter.swift */; }; 23 | 1B60503E1DE201F200B74DC3 /* TestContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B60503D1DE201F200B74DC3 /* TestContext.swift */; }; 24 | 1B6050401DE206CD00B74DC3 /* SilverMVCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B60501F1DE1FF3900B74DC3 /* SilverMVCTests.swift */; }; 25 | 1BAC96921E7F155100DEA523 /* NavigationViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAC96911E7F155100DEA523 /* NavigationViewProtocol.swift */; }; 26 | 1BAC96941E7F157300DEA523 /* WindowProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAC96931E7F157300DEA523 /* WindowProtocol.swift */; }; 27 | 1BAC96971E7F169C00DEA523 /* WindowProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAC96931E7F157300DEA523 /* WindowProtocol.swift */; }; 28 | 1BAC96981E7F169C00DEA523 /* NavigationViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAC96911E7F155100DEA523 /* NavigationViewProtocol.swift */; }; 29 | 1BAC96991E7F169C00DEA523 /* SilverMVC+UIKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BCBF8A51E5F243800FD91D8 /* SilverMVC+UIKit.swift */; }; 30 | 1BAC969A1E7F16A600DEA523 /* AppContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BC113541E71AC1100BB1955 /* AppContext.swift */; }; 31 | 1BC113551E71AC1100BB1955 /* AppContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BC113541E71AC1100BB1955 /* AppContext.swift */; }; 32 | 1BCBF89C1E5F139C00FD91D8 /* DetailsViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BCBF89B1E5F139C00FD91D8 /* DetailsViewProtocol.swift */; }; 33 | 1BCBF89D1E5F141800FD91D8 /* DetailsViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BCBF89B1E5F139C00FD91D8 /* DetailsViewProtocol.swift */; }; 34 | 1BCBF8A41E5F239A00FD91D8 /* TestRouting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BCBF8A21E5F239300FD91D8 /* TestRouting.swift */; }; 35 | 1BCBF8A61E5F243800FD91D8 /* SilverMVC+UIKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BCBF8A51E5F243800FD91D8 /* SilverMVC+UIKit.swift */; }; 36 | 1BD88B581DDEF1780059E401 /* TextLoaderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BD88B561DDEF1780059E401 /* TextLoaderProtocol.swift */; }; 37 | 1BD88B591DDEF1780059E401 /* TextLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BD88B571DDEF1780059E401 /* TextLoader.swift */; }; 38 | 1BF815901DDE15EC00D7DDAB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF8158F1DDE15EC00D7DDAB /* AppDelegate.swift */; }; 39 | 1BF815971DDE15EC00D7DDAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1BF815961DDE15EC00D7DDAB /* Assets.xcassets */; }; 40 | 1BF8159A1DDE15EC00D7DDAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1BF815981DDE15EC00D7DDAB /* LaunchScreen.storyboard */; }; 41 | 1BF815AE1DDE175700D7DDAB /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815AC1DDE175700D7DDAB /* MainView.swift */; }; 42 | 1BF815B11DDE176C00D7DDAB /* MainViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B01DDE176C00D7DDAB /* MainViewProtocol.swift */; }; 43 | 1BF815B51DDE185C00D7DDAB /* MainPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B41DDE185C00D7DDAB /* MainPresenter.swift */; }; 44 | 1BF815B71DDE1F7D00D7DDAB /* NavigationPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B61DDE1F7D00D7DDAB /* NavigationPresenter.swift */; }; 45 | 1BF815B91DDE217F00D7DDAB /* DetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BF815B81DDE217F00D7DDAB /* DetailsViewController.swift */; }; 46 | 1BFE8C5E1E5F42A8006BB281 /* WindowPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BFE8C5D1E5F42A8006BB281 /* WindowPresenter.swift */; }; 47 | 1BFE8C5F1E5F42DF006BB281 /* WindowPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BFE8C5D1E5F42A8006BB281 /* WindowPresenter.swift */; }; 48 | /* End PBXBuildFile section */ 49 | 50 | /* Begin PBXContainerItemProxy section */ 51 | 1B6050221DE1FF3900B74DC3 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 1BF815841DDE15EC00D7DDAB /* Project object */; 54 | proxyType = 1; 55 | remoteGlobalIDString = 1BF8158B1DDE15EC00D7DDAB; 56 | remoteInfo = SilverMVC; 57 | }; 58 | /* End PBXContainerItemProxy section */ 59 | 60 | /* Begin PBXFileReference section */ 61 | 1B158F6D1DDF21150069E60E /* Signal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Signal.swift; sourceTree = ""; }; 62 | 1B4581111DE1DBDE003F96A2 /* ProductionContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductionContext.swift; sourceTree = ""; }; 63 | 1B4581131DE1E47B003F96A2 /* ViewProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewProtocol.swift; sourceTree = ""; }; 64 | 1B60501D1DE1FF3900B74DC3 /* SilverMVCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SilverMVCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | 1B60501F1DE1FF3900B74DC3 /* SilverMVCTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SilverMVCTests.swift; sourceTree = ""; }; 66 | 1B6050211DE1FF3900B74DC3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 67 | 1B60503D1DE201F200B74DC3 /* TestContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestContext.swift; sourceTree = ""; }; 68 | 1BAC96911E7F155100DEA523 /* NavigationViewProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationViewProtocol.swift; sourceTree = ""; }; 69 | 1BAC96931E7F157300DEA523 /* WindowProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowProtocol.swift; sourceTree = ""; }; 70 | 1BC113541E71AC1100BB1955 /* AppContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppContext.swift; sourceTree = ""; }; 71 | 1BCBF89B1E5F139C00FD91D8 /* DetailsViewProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailsViewProtocol.swift; sourceTree = ""; }; 72 | 1BCBF8A21E5F239300FD91D8 /* TestRouting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestRouting.swift; sourceTree = ""; }; 73 | 1BCBF8A51E5F243800FD91D8 /* SilverMVC+UIKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SilverMVC+UIKit.swift"; sourceTree = ""; }; 74 | 1BD88B561DDEF1780059E401 /* TextLoaderProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextLoaderProtocol.swift; sourceTree = ""; }; 75 | 1BD88B571DDEF1780059E401 /* TextLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextLoader.swift; sourceTree = ""; }; 76 | 1BF8158C1DDE15EC00D7DDAB /* SilverMVC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SilverMVC.app; sourceTree = BUILT_PRODUCTS_DIR; }; 77 | 1BF8158F1DDE15EC00D7DDAB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 78 | 1BF815961DDE15EC00D7DDAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 79 | 1BF815991DDE15EC00D7DDAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 80 | 1BF8159B1DDE15EC00D7DDAB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 81 | 1BF815AC1DDE175700D7DDAB /* MainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; 82 | 1BF815B01DDE176C00D7DDAB /* MainViewProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewProtocol.swift; sourceTree = ""; }; 83 | 1BF815B41DDE185C00D7DDAB /* MainPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainPresenter.swift; sourceTree = ""; }; 84 | 1BF815B61DDE1F7D00D7DDAB /* NavigationPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationPresenter.swift; sourceTree = ""; }; 85 | 1BF815B81DDE217F00D7DDAB /* DetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailsViewController.swift; sourceTree = ""; }; 86 | 1BFE8C5D1E5F42A8006BB281 /* WindowPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowPresenter.swift; sourceTree = ""; }; 87 | /* End PBXFileReference section */ 88 | 89 | /* Begin PBXFrameworksBuildPhase section */ 90 | 1B60501A1DE1FF3900B74DC3 /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | 1BF815891DDE15EC00D7DDAB /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | ); 102 | runOnlyForDeploymentPostprocessing = 0; 103 | }; 104 | /* End PBXFrameworksBuildPhase section */ 105 | 106 | /* Begin PBXGroup section */ 107 | 1B45810A1DE1D67E003F96A2 /* View */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 1BFE8C5D1E5F42A8006BB281 /* WindowPresenter.swift */, 111 | 1BF815B61DDE1F7D00D7DDAB /* NavigationPresenter.swift */, 112 | 1BC113521E71ABE300BB1955 /* Main */, 113 | 1BC113531E71ABEB00BB1955 /* Details */, 114 | ); 115 | name = View; 116 | sourceTree = ""; 117 | }; 118 | 1B60501E1DE1FF3900B74DC3 /* SilverMVCTests */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 1BCBF8A11E5F238300FD91D8 /* Foundation */, 122 | 1B60503D1DE201F200B74DC3 /* TestContext.swift */, 123 | 1B60501F1DE1FF3900B74DC3 /* SilverMVCTests.swift */, 124 | 1B6050211DE1FF3900B74DC3 /* Info.plist */, 125 | ); 126 | path = SilverMVCTests; 127 | sourceTree = ""; 128 | }; 129 | 1BAC969B1E7F175100DEA523 /* Utils */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 1B158F6D1DDF21150069E60E /* Signal.swift */, 133 | ); 134 | name = Utils; 135 | sourceTree = ""; 136 | }; 137 | 1BC113521E71ABE300BB1955 /* Main */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 1BF815B01DDE176C00D7DDAB /* MainViewProtocol.swift */, 141 | 1BF815AC1DDE175700D7DDAB /* MainView.swift */, 142 | 1BF815B41DDE185C00D7DDAB /* MainPresenter.swift */, 143 | ); 144 | name = Main; 145 | sourceTree = ""; 146 | }; 147 | 1BC113531E71ABEB00BB1955 /* Details */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 1BCBF89B1E5F139C00FD91D8 /* DetailsViewProtocol.swift */, 151 | 1BF815B81DDE217F00D7DDAB /* DetailsViewController.swift */, 152 | ); 153 | name = Details; 154 | sourceTree = ""; 155 | }; 156 | 1BCBF89A1E5F12E200FD91D8 /* Context */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 1BC113541E71AC1100BB1955 /* AppContext.swift */, 160 | 1B4581111DE1DBDE003F96A2 /* ProductionContext.swift */, 161 | ); 162 | name = Context; 163 | sourceTree = ""; 164 | }; 165 | 1BCBF89F1E5F225200FD91D8 /* App */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 1BF8158F1DDE15EC00D7DDAB /* AppDelegate.swift */, 169 | ); 170 | name = App; 171 | sourceTree = ""; 172 | }; 173 | 1BCBF8A01E5F22F100FD91D8 /* Foundation */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 1B4581131DE1E47B003F96A2 /* ViewProtocol.swift */, 177 | 1BAC96931E7F157300DEA523 /* WindowProtocol.swift */, 178 | 1BAC96911E7F155100DEA523 /* NavigationViewProtocol.swift */, 179 | 1BCBF8A51E5F243800FD91D8 /* SilverMVC+UIKit.swift */, 180 | ); 181 | name = Foundation; 182 | sourceTree = ""; 183 | }; 184 | 1BCBF8A11E5F238300FD91D8 /* Foundation */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 1BCBF8A21E5F239300FD91D8 /* TestRouting.swift */, 188 | ); 189 | name = Foundation; 190 | sourceTree = ""; 191 | }; 192 | 1BF815831DDE15EC00D7DDAB = { 193 | isa = PBXGroup; 194 | children = ( 195 | 1BF8158E1DDE15EC00D7DDAB /* SilverMVC */, 196 | 1B60501E1DE1FF3900B74DC3 /* SilverMVCTests */, 197 | 1BF8158D1DDE15EC00D7DDAB /* Products */, 198 | ); 199 | sourceTree = ""; 200 | }; 201 | 1BF8158D1DDE15EC00D7DDAB /* Products */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 1BF8158C1DDE15EC00D7DDAB /* SilverMVC.app */, 205 | 1B60501D1DE1FF3900B74DC3 /* SilverMVCTests.xctest */, 206 | ); 207 | name = Products; 208 | sourceTree = ""; 209 | }; 210 | 1BF8158E1DDE15EC00D7DDAB /* SilverMVC */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | 1BAC969B1E7F175100DEA523 /* Utils */, 214 | 1BCBF8A01E5F22F100FD91D8 /* Foundation */, 215 | 1BCBF89F1E5F225200FD91D8 /* App */, 216 | 1BF815A51DDE165900D7DDAB /* Model */, 217 | 1B45810A1DE1D67E003F96A2 /* View */, 218 | 1BCBF89A1E5F12E200FD91D8 /* Context */, 219 | 1BFE8C5C1E5F4279006BB281 /* Resources */, 220 | ); 221 | path = SilverMVC; 222 | sourceTree = ""; 223 | }; 224 | 1BF815A51DDE165900D7DDAB /* Model */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 1BD88B561DDEF1780059E401 /* TextLoaderProtocol.swift */, 228 | 1BD88B571DDEF1780059E401 /* TextLoader.swift */, 229 | ); 230 | name = Model; 231 | sourceTree = ""; 232 | }; 233 | 1BFE8C5C1E5F4279006BB281 /* Resources */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 1BF815961DDE15EC00D7DDAB /* Assets.xcassets */, 237 | 1BF815981DDE15EC00D7DDAB /* LaunchScreen.storyboard */, 238 | 1BF8159B1DDE15EC00D7DDAB /* Info.plist */, 239 | ); 240 | name = Resources; 241 | sourceTree = ""; 242 | }; 243 | /* End PBXGroup section */ 244 | 245 | /* Begin PBXNativeTarget section */ 246 | 1B60501C1DE1FF3900B74DC3 /* SilverMVCTests */ = { 247 | isa = PBXNativeTarget; 248 | buildConfigurationList = 1B6050261DE1FF3900B74DC3 /* Build configuration list for PBXNativeTarget "SilverMVCTests" */; 249 | buildPhases = ( 250 | 1B6050191DE1FF3900B74DC3 /* Sources */, 251 | 1B60501A1DE1FF3900B74DC3 /* Frameworks */, 252 | 1B60501B1DE1FF3900B74DC3 /* Resources */, 253 | ); 254 | buildRules = ( 255 | ); 256 | dependencies = ( 257 | 1B6050231DE1FF3900B74DC3 /* PBXTargetDependency */, 258 | ); 259 | name = SilverMVCTests; 260 | productName = SilverMVCTests; 261 | productReference = 1B60501D1DE1FF3900B74DC3 /* SilverMVCTests.xctest */; 262 | productType = "com.apple.product-type.bundle.unit-test"; 263 | }; 264 | 1BF8158B1DDE15EC00D7DDAB /* SilverMVC */ = { 265 | isa = PBXNativeTarget; 266 | buildConfigurationList = 1BF8159E1DDE15EC00D7DDAB /* Build configuration list for PBXNativeTarget "SilverMVC" */; 267 | buildPhases = ( 268 | 1BF815881DDE15EC00D7DDAB /* Sources */, 269 | 1BF815891DDE15EC00D7DDAB /* Frameworks */, 270 | 1BF8158A1DDE15EC00D7DDAB /* Resources */, 271 | ); 272 | buildRules = ( 273 | ); 274 | dependencies = ( 275 | ); 276 | name = SilverMVC; 277 | productName = SilverMVC; 278 | productReference = 1BF8158C1DDE15EC00D7DDAB /* SilverMVC.app */; 279 | productType = "com.apple.product-type.application"; 280 | }; 281 | /* End PBXNativeTarget section */ 282 | 283 | /* Begin PBXProject section */ 284 | 1BF815841DDE15EC00D7DDAB /* Project object */ = { 285 | isa = PBXProject; 286 | attributes = { 287 | LastSwiftUpdateCheck = 0820; 288 | LastUpgradeCheck = 1000; 289 | ORGANIZATIONNAME = psharanda; 290 | TargetAttributes = { 291 | 1B60501C1DE1FF3900B74DC3 = { 292 | CreatedOnToolsVersion = 8.2; 293 | LastSwiftMigration = 1000; 294 | ProvisioningStyle = Automatic; 295 | TestTargetID = 1BF8158B1DDE15EC00D7DDAB; 296 | }; 297 | 1BF8158B1DDE15EC00D7DDAB = { 298 | CreatedOnToolsVersion = 8.2; 299 | LastSwiftMigration = 1000; 300 | ProvisioningStyle = Automatic; 301 | }; 302 | }; 303 | }; 304 | buildConfigurationList = 1BF815871DDE15EC00D7DDAB /* Build configuration list for PBXProject "SilverMVC" */; 305 | compatibilityVersion = "Xcode 3.2"; 306 | developmentRegion = English; 307 | hasScannedForEncodings = 0; 308 | knownRegions = ( 309 | en, 310 | Base, 311 | ); 312 | mainGroup = 1BF815831DDE15EC00D7DDAB; 313 | productRefGroup = 1BF8158D1DDE15EC00D7DDAB /* Products */; 314 | projectDirPath = ""; 315 | projectRoot = ""; 316 | targets = ( 317 | 1BF8158B1DDE15EC00D7DDAB /* SilverMVC */, 318 | 1B60501C1DE1FF3900B74DC3 /* SilverMVCTests */, 319 | ); 320 | }; 321 | /* End PBXProject section */ 322 | 323 | /* Begin PBXResourcesBuildPhase section */ 324 | 1B60501B1DE1FF3900B74DC3 /* Resources */ = { 325 | isa = PBXResourcesBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | }; 331 | 1BF8158A1DDE15EC00D7DDAB /* Resources */ = { 332 | isa = PBXResourcesBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | 1BF8159A1DDE15EC00D7DDAB /* LaunchScreen.storyboard in Resources */, 336 | 1BF815971DDE15EC00D7DDAB /* Assets.xcassets in Resources */, 337 | ); 338 | runOnlyForDeploymentPostprocessing = 0; 339 | }; 340 | /* End PBXResourcesBuildPhase section */ 341 | 342 | /* Begin PBXSourcesBuildPhase section */ 343 | 1B6050191DE1FF3900B74DC3 /* Sources */ = { 344 | isa = PBXSourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | 1BFE8C5F1E5F42DF006BB281 /* WindowPresenter.swift in Sources */, 348 | 1BAC96981E7F169C00DEA523 /* NavigationViewProtocol.swift in Sources */, 349 | 1BCBF89D1E5F141800FD91D8 /* DetailsViewProtocol.swift in Sources */, 350 | 1B6050361DE201DE00B74DC3 /* MainPresenter.swift in Sources */, 351 | 1BAC96991E7F169C00DEA523 /* SilverMVC+UIKit.swift in Sources */, 352 | 1B60503B1DE201DE00B74DC3 /* DetailsViewController.swift in Sources */, 353 | 1B60503A1DE201DE00B74DC3 /* TextLoader.swift in Sources */, 354 | 1B6050321DE201DE00B74DC3 /* ProductionContext.swift in Sources */, 355 | 1B6050391DE201DE00B74DC3 /* TextLoaderProtocol.swift in Sources */, 356 | 1B6050341DE201DE00B74DC3 /* MainViewProtocol.swift in Sources */, 357 | 1B60503C1DE201DE00B74DC3 /* NavigationPresenter.swift in Sources */, 358 | 1BAC96971E7F169C00DEA523 /* WindowProtocol.swift in Sources */, 359 | 1B6050381DE201DE00B74DC3 /* Signal.swift in Sources */, 360 | 1BAC969A1E7F16A600DEA523 /* AppContext.swift in Sources */, 361 | 1B6050331DE201DE00B74DC3 /* ViewProtocol.swift in Sources */, 362 | 1B6050351DE201DE00B74DC3 /* MainView.swift in Sources */, 363 | 1B6050401DE206CD00B74DC3 /* SilverMVCTests.swift in Sources */, 364 | 1BCBF8A41E5F239A00FD91D8 /* TestRouting.swift in Sources */, 365 | 1B60503E1DE201F200B74DC3 /* TestContext.swift in Sources */, 366 | ); 367 | runOnlyForDeploymentPostprocessing = 0; 368 | }; 369 | 1BF815881DDE15EC00D7DDAB /* Sources */ = { 370 | isa = PBXSourcesBuildPhase; 371 | buildActionMask = 2147483647; 372 | files = ( 373 | 1BF815B71DDE1F7D00D7DDAB /* NavigationPresenter.swift in Sources */, 374 | 1BC113551E71AC1100BB1955 /* AppContext.swift in Sources */, 375 | 1B4581141DE1E47B003F96A2 /* ViewProtocol.swift in Sources */, 376 | 1BCBF8A61E5F243800FD91D8 /* SilverMVC+UIKit.swift in Sources */, 377 | 1BF815B91DDE217F00D7DDAB /* DetailsViewController.swift in Sources */, 378 | 1BAC96921E7F155100DEA523 /* NavigationViewProtocol.swift in Sources */, 379 | 1B4581121DE1DBDE003F96A2 /* ProductionContext.swift in Sources */, 380 | 1BF815901DDE15EC00D7DDAB /* AppDelegate.swift in Sources */, 381 | 1BCBF89C1E5F139C00FD91D8 /* DetailsViewProtocol.swift in Sources */, 382 | 1BF815B51DDE185C00D7DDAB /* MainPresenter.swift in Sources */, 383 | 1BFE8C5E1E5F42A8006BB281 /* WindowPresenter.swift in Sources */, 384 | 1B158F6E1DDF21150069E60E /* Signal.swift in Sources */, 385 | 1BD88B581DDEF1780059E401 /* TextLoaderProtocol.swift in Sources */, 386 | 1BF815B11DDE176C00D7DDAB /* MainViewProtocol.swift in Sources */, 387 | 1BF815AE1DDE175700D7DDAB /* MainView.swift in Sources */, 388 | 1BAC96941E7F157300DEA523 /* WindowProtocol.swift in Sources */, 389 | 1BD88B591DDEF1780059E401 /* TextLoader.swift in Sources */, 390 | ); 391 | runOnlyForDeploymentPostprocessing = 0; 392 | }; 393 | /* End PBXSourcesBuildPhase section */ 394 | 395 | /* Begin PBXTargetDependency section */ 396 | 1B6050231DE1FF3900B74DC3 /* PBXTargetDependency */ = { 397 | isa = PBXTargetDependency; 398 | target = 1BF8158B1DDE15EC00D7DDAB /* SilverMVC */; 399 | targetProxy = 1B6050221DE1FF3900B74DC3 /* PBXContainerItemProxy */; 400 | }; 401 | /* End PBXTargetDependency section */ 402 | 403 | /* Begin PBXVariantGroup section */ 404 | 1BF815981DDE15EC00D7DDAB /* LaunchScreen.storyboard */ = { 405 | isa = PBXVariantGroup; 406 | children = ( 407 | 1BF815991DDE15EC00D7DDAB /* Base */, 408 | ); 409 | name = LaunchScreen.storyboard; 410 | sourceTree = ""; 411 | }; 412 | /* End PBXVariantGroup section */ 413 | 414 | /* Begin XCBuildConfiguration section */ 415 | 1B6050241DE1FF3900B74DC3 /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | BUNDLE_LOADER = "$(TEST_HOST)"; 419 | INFOPLIST_FILE = SilverMVCTests/Info.plist; 420 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 421 | PRODUCT_BUNDLE_IDENTIFIER = org.psharanda.SilverMVCTests; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | SWIFT_VERSION = 4.2; 424 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SilverMVC.app/SilverMVC"; 425 | }; 426 | name = Debug; 427 | }; 428 | 1B6050251DE1FF3900B74DC3 /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | BUNDLE_LOADER = "$(TEST_HOST)"; 432 | INFOPLIST_FILE = SilverMVCTests/Info.plist; 433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 434 | PRODUCT_BUNDLE_IDENTIFIER = org.psharanda.SilverMVCTests; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_VERSION = 4.2; 437 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SilverMVC.app/SilverMVC"; 438 | }; 439 | name = Release; 440 | }; 441 | 1BF8159C1DDE15EC00D7DDAB /* Debug */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ALWAYS_SEARCH_USER_PATHS = NO; 445 | CLANG_ANALYZER_NONNULL = YES; 446 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 447 | CLANG_CXX_LIBRARY = "libc++"; 448 | CLANG_ENABLE_MODULES = YES; 449 | CLANG_ENABLE_OBJC_ARC = YES; 450 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 451 | CLANG_WARN_BOOL_CONVERSION = YES; 452 | CLANG_WARN_COMMA = YES; 453 | CLANG_WARN_CONSTANT_CONVERSION = YES; 454 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 455 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 456 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 457 | CLANG_WARN_EMPTY_BODY = YES; 458 | CLANG_WARN_ENUM_CONVERSION = YES; 459 | CLANG_WARN_INFINITE_RECURSION = YES; 460 | CLANG_WARN_INT_CONVERSION = YES; 461 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 462 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 463 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 464 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 465 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 466 | CLANG_WARN_STRICT_PROTOTYPES = YES; 467 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 468 | CLANG_WARN_UNREACHABLE_CODE = YES; 469 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 470 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 471 | COPY_PHASE_STRIP = NO; 472 | DEBUG_INFORMATION_FORMAT = dwarf; 473 | ENABLE_STRICT_OBJC_MSGSEND = YES; 474 | ENABLE_TESTABILITY = YES; 475 | GCC_C_LANGUAGE_STANDARD = gnu99; 476 | GCC_DYNAMIC_NO_PIC = NO; 477 | GCC_NO_COMMON_BLOCKS = YES; 478 | GCC_OPTIMIZATION_LEVEL = 0; 479 | GCC_PREPROCESSOR_DEFINITIONS = ( 480 | "DEBUG=1", 481 | "$(inherited)", 482 | ); 483 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 484 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 485 | GCC_WARN_UNDECLARED_SELECTOR = YES; 486 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 487 | GCC_WARN_UNUSED_FUNCTION = YES; 488 | GCC_WARN_UNUSED_VARIABLE = YES; 489 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 490 | MTL_ENABLE_DEBUG_INFO = YES; 491 | ONLY_ACTIVE_ARCH = YES; 492 | SDKROOT = iphoneos; 493 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 494 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 495 | }; 496 | name = Debug; 497 | }; 498 | 1BF8159D1DDE15EC00D7DDAB /* Release */ = { 499 | isa = XCBuildConfiguration; 500 | buildSettings = { 501 | ALWAYS_SEARCH_USER_PATHS = NO; 502 | CLANG_ANALYZER_NONNULL = YES; 503 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 504 | CLANG_CXX_LIBRARY = "libc++"; 505 | CLANG_ENABLE_MODULES = YES; 506 | CLANG_ENABLE_OBJC_ARC = YES; 507 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 508 | CLANG_WARN_BOOL_CONVERSION = YES; 509 | CLANG_WARN_COMMA = YES; 510 | CLANG_WARN_CONSTANT_CONVERSION = YES; 511 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 512 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 513 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 514 | CLANG_WARN_EMPTY_BODY = YES; 515 | CLANG_WARN_ENUM_CONVERSION = YES; 516 | CLANG_WARN_INFINITE_RECURSION = YES; 517 | CLANG_WARN_INT_CONVERSION = YES; 518 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 519 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 520 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 521 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 522 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 523 | CLANG_WARN_STRICT_PROTOTYPES = YES; 524 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 525 | CLANG_WARN_UNREACHABLE_CODE = YES; 526 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 527 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 528 | COPY_PHASE_STRIP = NO; 529 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 530 | ENABLE_NS_ASSERTIONS = NO; 531 | ENABLE_STRICT_OBJC_MSGSEND = YES; 532 | GCC_C_LANGUAGE_STANDARD = gnu99; 533 | GCC_NO_COMMON_BLOCKS = YES; 534 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 535 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 536 | GCC_WARN_UNDECLARED_SELECTOR = YES; 537 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 538 | GCC_WARN_UNUSED_FUNCTION = YES; 539 | GCC_WARN_UNUSED_VARIABLE = YES; 540 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 541 | MTL_ENABLE_DEBUG_INFO = NO; 542 | SDKROOT = iphoneos; 543 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 544 | VALIDATE_PRODUCT = YES; 545 | }; 546 | name = Release; 547 | }; 548 | 1BF8159F1DDE15EC00D7DDAB /* Debug */ = { 549 | isa = XCBuildConfiguration; 550 | buildSettings = { 551 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 552 | INFOPLIST_FILE = SilverMVC/Info.plist; 553 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 554 | PRODUCT_BUNDLE_IDENTIFIER = org.psharanda.SilverMVC; 555 | PRODUCT_NAME = "$(TARGET_NAME)"; 556 | SWIFT_VERSION = 4.2; 557 | }; 558 | name = Debug; 559 | }; 560 | 1BF815A01DDE15EC00D7DDAB /* Release */ = { 561 | isa = XCBuildConfiguration; 562 | buildSettings = { 563 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 564 | INFOPLIST_FILE = SilverMVC/Info.plist; 565 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 566 | PRODUCT_BUNDLE_IDENTIFIER = org.psharanda.SilverMVC; 567 | PRODUCT_NAME = "$(TARGET_NAME)"; 568 | SWIFT_VERSION = 4.2; 569 | }; 570 | name = Release; 571 | }; 572 | /* End XCBuildConfiguration section */ 573 | 574 | /* Begin XCConfigurationList section */ 575 | 1B6050261DE1FF3900B74DC3 /* Build configuration list for PBXNativeTarget "SilverMVCTests" */ = { 576 | isa = XCConfigurationList; 577 | buildConfigurations = ( 578 | 1B6050241DE1FF3900B74DC3 /* Debug */, 579 | 1B6050251DE1FF3900B74DC3 /* Release */, 580 | ); 581 | defaultConfigurationIsVisible = 0; 582 | defaultConfigurationName = Release; 583 | }; 584 | 1BF815871DDE15EC00D7DDAB /* Build configuration list for PBXProject "SilverMVC" */ = { 585 | isa = XCConfigurationList; 586 | buildConfigurations = ( 587 | 1BF8159C1DDE15EC00D7DDAB /* Debug */, 588 | 1BF8159D1DDE15EC00D7DDAB /* Release */, 589 | ); 590 | defaultConfigurationIsVisible = 0; 591 | defaultConfigurationName = Release; 592 | }; 593 | 1BF8159E1DDE15EC00D7DDAB /* Build configuration list for PBXNativeTarget "SilverMVC" */ = { 594 | isa = XCConfigurationList; 595 | buildConfigurations = ( 596 | 1BF8159F1DDE15EC00D7DDAB /* Debug */, 597 | 1BF815A01DDE15EC00D7DDAB /* Release */, 598 | ); 599 | defaultConfigurationIsVisible = 0; 600 | defaultConfigurationName = Release; 601 | }; 602 | /* End XCConfigurationList section */ 603 | }; 604 | rootObject = 1BF815841DDE15EC00D7DDAB /* Project object */; 605 | } 606 | -------------------------------------------------------------------------------- /SilverMVC.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SilverMVC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SilverMVC.xcodeproj/project.xcworkspace/xcshareddata/SilverMVC.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "0865603D9C9AB5212704F533C1AF115A900A307D", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "B5219BAF2DA70724495960557F2F42BC2AF0C4A6" : 9223372036854775807, 8 | "0865603D9C9AB5212704F533C1AF115A900A307D" : 9223372036854775807 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "024AF1EB-62D2-4F53-924E-552C27CD4A24", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "B5219BAF2DA70724495960557F2F42BC2AF0C4A6" : "vmc2\/", 13 | "0865603D9C9AB5212704F533C1AF115A900A307D" : "SilverMVC\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "SilverMVC", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "SilverMVC.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/psharanda\/SilverMVC.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "0865603D9C9AB5212704F533C1AF115A900A307D" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/psharanda\/vmc2.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B5219BAF2DA70724495960557F2F42BC2AF0C4A6" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /SilverMVC/AppContext.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 09.03.17. 3 | // Copyright © 2017 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | typealias AppContext = TextLoaderContainer 9 | & MainViewContainer 10 | & NavigationViewContainer 11 | & WindowContainer 12 | & DetailsViewContainer 13 | -------------------------------------------------------------------------------- /SilverMVC/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import UIKit 7 | 8 | @UIApplicationMain 9 | class AppDelegate: UIResponder, UIApplicationDelegate { 10 | 11 | private let context = ProductionContext() 12 | private lazy var window: WindowProtocol = self.context.makeWindow() 13 | 14 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 15 | 16 | window.presenter = WindowPresenter(window: window, context: context) 17 | window.makeKeyAndVisible() 18 | 19 | return true 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SilverMVC/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /SilverMVC/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 | -------------------------------------------------------------------------------- /SilverMVC/DetailsViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import UIKit 7 | 8 | class DetailsViewController: UIViewController, DetailsViewProtocol { 9 | 10 | 11 | private lazy var label = UILabel() 12 | 13 | private let text: String 14 | 15 | init(text: String) { 16 | self.text = text 17 | super.init(nibName: nil, bundle: nil) 18 | } 19 | 20 | required init?(coder aDecoder: NSCoder) { 21 | fatalError("init(coder:) has not been implemented") 22 | } 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | 27 | title = "Details" 28 | 29 | view.backgroundColor = .white 30 | 31 | label.numberOfLines = 0 32 | label.text = text.uppercased() 33 | view.addSubview(label) 34 | } 35 | 36 | override func viewDidLayoutSubviews() { 37 | super.viewDidLayoutSubviews() 38 | 39 | 40 | label.frame = view.bounds.inset(by: UIEdgeInsets(top: 80, left: 20, bottom: 80, right: 20)) 41 | 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /SilverMVC/DetailsViewProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailsViewControllerProtocol.swift 3 | // MVPBRF 4 | 5 | import Foundation 6 | 7 | protocol DetailsViewProtocol: ViewProtocol { 8 | 9 | } 10 | 11 | protocol DetailsViewContainer { 12 | func makeDetailsView(text: String) -> DetailsViewProtocol 13 | } 14 | -------------------------------------------------------------------------------- /SilverMVC/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /SilverMVC/MainPresenter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | class MainPresenter { 9 | 10 | var showDetails = Signal() 11 | 12 | let textLoader: TextLoaderProtocol 13 | unowned let view: MainViewProtocol 14 | 15 | init(textLoader: TextLoaderProtocol, view: MainViewProtocol) { 16 | self.textLoader = textLoader 17 | self.view = view 18 | 19 | view.detailsClick.subscribe {[unowned self] in 20 | self.showDetails.update(()) 21 | } 22 | 23 | view.loadClick.subscribe {[unowned self] in 24 | 25 | self.view.state = .loading 26 | self.textLoader.loadText { 27 | self.view.state = .text($0) 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SilverMVC/MainView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import UIKit 7 | 8 | class MainView: UIViewController, MainViewProtocol { 9 | 10 | 11 | private lazy var button = UIButton(type: .system) 12 | private lazy var label = UILabel() 13 | private lazy var activityIndicator = UIActivityIndicatorView(style: .gray) 14 | 15 | 16 | var state: MainViewState = .initial { 17 | didSet { 18 | render(oldState: oldValue, newState: state) 19 | } 20 | } 21 | 22 | let loadClick = Signal() 23 | let detailsClick = Signal() 24 | 25 | //MARK: 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | 30 | title = "SilverMVC" 31 | 32 | view.backgroundColor = .white 33 | 34 | view.addSubview(activityIndicator) 35 | 36 | button.setTitle("Load", for: .normal) 37 | button.addTarget(self, action: #selector(buttonClicked), for: .touchUpInside) 38 | view.addSubview(button) 39 | 40 | label.numberOfLines = 0 41 | view.addSubview(label) 42 | 43 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Details", style: .plain, target: self, action: #selector(detailsClicked)) 44 | 45 | render(oldState: state, newState: state) 46 | } 47 | 48 | override func viewDidLayoutSubviews() { 49 | super.viewDidLayoutSubviews() 50 | 51 | activityIndicator.frame = view.bounds 52 | label.frame = view.bounds.inset(by: UIEdgeInsets(top: 80, left: 20, bottom: 80, right: 20)) 53 | button.frame = CGRect(x: 20, y: view.bounds.height - 60, width: view.bounds.width - 40, height: 40) 54 | } 55 | 56 | //MARK: 57 | 58 | @objc private func detailsClicked() { 59 | detailsClick.update(()) 60 | } 61 | 62 | @objc private func buttonClicked() { 63 | loadClick.update(()) 64 | } 65 | 66 | //MARK: - 67 | 68 | func render(oldState: MainViewState, newState: MainViewState) { 69 | 70 | switch state { 71 | case .initial: 72 | label.text = nil 73 | navigationItem.rightBarButtonItem?.isEnabled = false 74 | activityIndicator.stopAnimating() 75 | button.isEnabled = true 76 | case .loading: 77 | label.text = nil 78 | activityIndicator.startAnimating() 79 | navigationItem.rightBarButtonItem?.isEnabled = false 80 | button.isEnabled = false 81 | case .text(let text): 82 | label.text = text 83 | activityIndicator.stopAnimating() 84 | navigationItem.rightBarButtonItem?.isEnabled = true 85 | button.isEnabled = true 86 | } 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /SilverMVC/MainViewProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | enum MainViewState { 9 | case initial 10 | case loading 11 | case text(String) 12 | 13 | var text: String? { 14 | switch self { 15 | case .initial: 16 | return nil 17 | case .loading: 18 | return nil 19 | case .text(let t): 20 | return t 21 | } 22 | } 23 | } 24 | 25 | protocol MainViewProtocol: ViewProtocol { 26 | 27 | var loadClick: Signal {get} 28 | var detailsClick: Signal {get} 29 | 30 | var state: MainViewState {get set} 31 | } 32 | 33 | protocol MainViewContainer { 34 | func makeMainView() -> MainViewProtocol 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /SilverMVC/NavigationPresenter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | 9 | class NavigationPresenter { 10 | 11 | unowned let navigationView: NavigationViewProtocol 12 | let context: AppContext 13 | 14 | init(navigationView: NavigationViewProtocol, context: AppContext) { 15 | self.context = context 16 | self.navigationView = navigationView 17 | 18 | navigationView.views = [setupMainView()] 19 | } 20 | 21 | func setupMainView() -> MainViewProtocol { 22 | let view = context.makeMainView() 23 | let presenter = MainPresenter(textLoader: context.makeTextLoader(), view: view) 24 | view.presenter = presenter 25 | 26 | presenter.showDetails.subscribe {[unowned self, unowned presenter] in 27 | let vc = self.context.makeDetailsView(text: presenter.view.state.text ?? "WTF?") 28 | self.navigationView.pushView(view: vc, animated: true) 29 | } 30 | 31 | return view 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SilverMVC/NavigationViewProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 19.03.17. 3 | // Copyright © 2017 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | protocol NavigationViewProtocol: ViewProtocol { 9 | func pushView(view: ViewProtocol, animated: Bool) 10 | func popView(view: ViewProtocol, animated: Bool) -> ViewProtocol? 11 | 12 | var views: [ViewProtocol] {get set} 13 | } 14 | 15 | protocol NavigationViewContainer { 16 | func makeNavigationView() -> NavigationViewProtocol 17 | } 18 | -------------------------------------------------------------------------------- /SilverMVC/ProductionContext.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 20.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import UIKit 7 | 8 | class ProductionContext: AppContext { 9 | 10 | //example of internal singleton 11 | private static let textLoader = TextLoader() 12 | func makeTextLoader() -> TextLoaderProtocol { 13 | return ProductionContext.textLoader 14 | } 15 | 16 | func makeMainView() -> MainViewProtocol { 17 | return MainView() 18 | } 19 | 20 | func makeDetailsView(text: String) -> DetailsViewProtocol { 21 | return DetailsViewController(text: text) 22 | } 23 | 24 | func makeNavigationView() -> NavigationViewProtocol { 25 | return UINavigationController() 26 | } 27 | 28 | func makeWindow() -> WindowProtocol { 29 | return UIWindow(frame: UIScreen.main.bounds) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SilverMVC/Signal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | 9 | class Signal { 10 | 11 | private var value: T? 12 | 13 | private var callbacks: [(T)->Void] = [] 14 | 15 | var lastValue: T? { 16 | return value 17 | } 18 | 19 | func subscribe(_ callback: @escaping (T)->Void) { 20 | 21 | callbacks.append(callback) 22 | 23 | if let value = value { 24 | callback(value) 25 | } 26 | } 27 | 28 | func update(_ newValue: T) { 29 | value = newValue 30 | 31 | callbacks.forEach { 32 | $0(newValue) 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SilverMVC/SilverMVC+UIKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 23.02.17. 3 | // Copyright © 2017 psharanda. All rights reserved. 4 | // 5 | 6 | import UIKit 7 | 8 | private var presenterKey: Int = 0 9 | 10 | extension UIViewController: ViewProtocol { 11 | 12 | var presenter: AnyObject? { 13 | get { 14 | return objc_getAssociatedObject(self, &presenterKey) as AnyObject 15 | } 16 | 17 | set { 18 | objc_setAssociatedObject(self, &presenterKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 19 | } 20 | } 21 | } 22 | 23 | extension UIWindow: WindowProtocol { 24 | 25 | var rootView: ViewProtocol? { 26 | set { 27 | rootViewController = newValue as! UIViewController? 28 | } 29 | get { 30 | return rootViewController 31 | } 32 | } 33 | 34 | var presenter: AnyObject? { 35 | get { 36 | return objc_getAssociatedObject(self, &presenterKey) as AnyObject 37 | } 38 | 39 | set { 40 | objc_setAssociatedObject(self, &presenterKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 41 | } 42 | } 43 | } 44 | 45 | extension UINavigationController: NavigationViewProtocol { 46 | 47 | func pushView(view: ViewProtocol, animated: Bool) { 48 | pushViewController(view as! UIViewController, animated: animated) 49 | } 50 | 51 | func popView(view: ViewProtocol, animated: Bool) -> ViewProtocol? { 52 | return popViewController(animated: animated) 53 | } 54 | 55 | var views: [ViewProtocol] { 56 | set { 57 | viewControllers = newValue.map { $0 as! UIViewController } 58 | } 59 | get { 60 | return viewControllers 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /SilverMVC/TextLoader.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | class TextLoader: TextLoaderProtocol { 9 | func loadText(completion: @escaping (String)->Void) { 10 | DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1)) { 11 | completion("Cras mattis consectetur purus sit amet fermentum. Donec ullamcorper nulla non metus auctor fringilla. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean lacinia bibendum nulla sed consectetur. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.") 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SilverMVC/TextLoaderProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 17.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | protocol TextLoaderProtocol { 9 | func loadText(completion: @escaping (String)->Void) 10 | } 11 | 12 | protocol TextLoaderContainer { 13 | func makeTextLoader() -> TextLoaderProtocol 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /SilverMVC/ViewProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 20.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | protocol ViewProtocol: class { 9 | var presenter: AnyObject? {get set} 10 | } 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SilverMVC/WindowPresenter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 23.02.17. 3 | // Copyright © 2017 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | class WindowPresenter { 9 | 10 | unowned let window: WindowProtocol 11 | let context: AppContext 12 | 13 | init(window: WindowProtocol, context: AppContext) { 14 | self.context = context 15 | self.window = window 16 | 17 | 18 | 19 | 20 | let navigationView = context.makeNavigationView() 21 | navigationView.presenter = NavigationPresenter(navigationView: navigationView, context: context) 22 | window.rootView = navigationView 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SilverMVC/WindowProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 19.03.17. 3 | // Copyright © 2017 psharanda. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | 8 | protocol WindowProtocol: ViewProtocol { 9 | var rootView: ViewProtocol? {get set} 10 | func makeKeyAndVisible() 11 | } 12 | 13 | protocol WindowContainer { 14 | func makeWindow() -> WindowProtocol 15 | } 16 | -------------------------------------------------------------------------------- /SilverMVCTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SilverMVCTests/SilverMVCTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VIPERTests.swift 3 | // VIPERTests 4 | // 5 | // Created by Pavel Sharanda on 20.11.16. 6 | // Copyright © 2016 psharanda. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SilverMVCTests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | super.tearDown() 21 | } 22 | 23 | func testExample() { 24 | let res = "Lorem Ipsum" 25 | 26 | var config = TestContext.Config() 27 | config.text = res 28 | 29 | let context = TestContext(config: config) 30 | 31 | let window = context.makeWindow() 32 | window.presenter = WindowPresenter(window: window, context: context) 33 | 34 | let navigationView = window.rootView as! NavigationViewProtocol 35 | let mainView = navigationView.views[0] as! TestMainView 36 | mainView.loadClick.update(()) 37 | 38 | XCTAssertEqual(mainView.state.text, res) 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /SilverMVCTests/TestContext.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 20.11.16. 3 | // Copyright © 2016 psharanda. All rights reserved. 4 | // 5 | 6 | import UIKit 7 | 8 | class TestTextLoader: TextLoaderProtocol { 9 | let text: String 10 | init(text: String) { 11 | self.text = text 12 | } 13 | func loadText(completion: @escaping (String) -> Void) { 14 | completion(text) 15 | } 16 | } 17 | 18 | 19 | class TestMainView: TestView, MainViewProtocol { 20 | 21 | var loadClick = Signal() 22 | var detailsClick = Signal() 23 | 24 | var state: MainViewState = .initial 25 | 26 | var viewController: UIViewController { 27 | fatalError() 28 | } 29 | } 30 | 31 | class TestDetailsView: TestView, DetailsViewProtocol { 32 | 33 | let text: String 34 | 35 | init(text: String) { 36 | self.text = text 37 | } 38 | 39 | var viewController: UIViewController { 40 | fatalError() 41 | } 42 | } 43 | 44 | class TestContext: AppContext { 45 | 46 | struct Config { 47 | var text = "Hello" 48 | } 49 | let config: Config 50 | init(config: Config) { 51 | self.config = config 52 | } 53 | 54 | func makeTextLoader() -> TextLoaderProtocol { 55 | return TestTextLoader(text: config.text) 56 | } 57 | 58 | func makeMainView() -> MainViewProtocol { 59 | return TestMainView() 60 | } 61 | 62 | func makeNavigationView() -> NavigationViewProtocol { 63 | return TestNavigationView() 64 | } 65 | 66 | func makeWindow() -> WindowProtocol { 67 | return TestWindow() 68 | } 69 | 70 | func makeDetailsView(text: String) -> DetailsViewProtocol { 71 | return TestDetailsView(text: text) 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /SilverMVCTests/TestRouting.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Pavel Sharanda on 23.02.17. 3 | // Copyright © 2017 psharanda. All rights reserved. 4 | // 5 | 6 | import UIKit 7 | 8 | class TestView { 9 | var presenter: AnyObject? 10 | } 11 | 12 | class TestNavigationView: TestView, NavigationViewProtocol { 13 | func pushView(view: ViewProtocol, animated: Bool) { 14 | views.append(view) 15 | } 16 | 17 | func popView(view: ViewProtocol, animated: Bool) -> ViewProtocol? { 18 | return views.removeLast() 19 | } 20 | 21 | var views: [ViewProtocol] = [] 22 | 23 | var viewController: UIViewController { 24 | fatalError() 25 | } 26 | } 27 | 28 | class TestWindow: TestView, WindowProtocol { 29 | var rootView: ViewProtocol? 30 | func makeKeyAndVisible() { 31 | 32 | } 33 | } 34 | --------------------------------------------------------------------------------