├── ModularisationHorizontal ├── ModularisationHorizontal.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── sashensingh.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── ModularisationHorizontal.xcscheme │ └── xcuserdata │ │ └── sashensingh.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── ModularisationHorizontal │ ├── AppDelegate.swift │ ├── AppDependencyContainer.swift │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── Packages │ │ ├── Feature │ │ │ ├── .gitignore │ │ │ ├── .swiftpm │ │ │ │ └── xcode │ │ │ │ │ ├── package.xcworkspace │ │ │ │ │ └── xcshareddata │ │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ └── Feature.xcscheme │ │ │ ├── Package.swift │ │ │ ├── README.md │ │ │ ├── Sources │ │ │ │ └── Feature │ │ │ │ │ ├── Feature1 │ │ │ │ │ ├── Feature1Model.swift │ │ │ │ │ └── Feature1Service.swift │ │ │ │ │ └── Feature2 │ │ │ │ │ ├── Feature2Model.swift │ │ │ │ │ └── Feature2Service.swift │ │ │ └── Tests │ │ │ │ └── FeatureTests │ │ │ │ └── FeatureTests.swift │ │ ├── FeatureImplementation │ │ │ ├── .gitignore │ │ │ ├── .swiftpm │ │ │ │ └── xcode │ │ │ │ │ ├── package.xcworkspace │ │ │ │ │ └── xcshareddata │ │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ └── FeatureImplementation.xcscheme │ │ │ ├── Package.swift │ │ │ ├── README.md │ │ │ ├── Sources │ │ │ │ └── FeatureImplementation │ │ │ │ │ ├── Feature1 │ │ │ │ │ ├── Feature1ServiceImplementation.swift │ │ │ │ │ └── Feature1ServiceModel.swift │ │ │ │ │ └── Feature2 │ │ │ │ │ ├── Feature2ServiceImplementation.swift │ │ │ │ │ └── Feature2ServiceModel.swift │ │ │ └── Tests │ │ │ │ └── FeatureImplementationTests │ │ │ │ └── FeatureImplementationTests.swift │ │ ├── Presentation │ │ │ ├── .gitignore │ │ │ ├── .swiftpm │ │ │ │ └── xcode │ │ │ │ │ ├── package.xcworkspace │ │ │ │ │ └── xcshareddata │ │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ └── Presentation.xcscheme │ │ │ ├── Package.swift │ │ │ ├── README.md │ │ │ ├── Sources │ │ │ │ └── Presentation │ │ │ │ │ ├── Feature1 │ │ │ │ │ └── Feature1ViewModel.swift │ │ │ │ │ └── Feature2 │ │ │ │ │ └── Feature2ViewModel.swift │ │ │ └── Tests │ │ │ │ └── PresentationTests │ │ │ │ └── PresentationTests.swift │ │ └── UI │ │ │ ├── .gitignore │ │ │ ├── .swiftpm │ │ │ └── xcode │ │ │ │ ├── package.xcworkspace │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── UI.xcscheme │ │ │ ├── Package.swift │ │ │ ├── README.md │ │ │ ├── Sources │ │ │ └── UI │ │ │ │ ├── Feature1 │ │ │ │ ├── Feature1DependencyContainer.swift │ │ │ │ └── Feature1ViewController.swift │ │ │ │ ├── Feature2 │ │ │ │ ├── Feature2DependencyContainer.swift │ │ │ │ └── Feature2ViewController.swift │ │ │ │ └── UI.swift │ │ │ └── Tests │ │ │ └── UITests │ │ │ └── UITests.swift │ ├── SceneDelegate.swift │ └── ViewController.swift └── UIExampleApp │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── ExampleAppDependencyContainer.swift │ ├── Info.plist │ ├── Mocks │ ├── Feature1ServiceMock.swift │ └── Feature2ServiceMock.swift │ ├── SceneDelegate.swift │ └── ViewController.swift ├── ModularisationStarter ├── ModularisationStarter.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── sashensingh.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── sashensingh.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist └── ModularisationStarter │ ├── AppDelegate.swift │ ├── AppDependencyContainer.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── Models │ ├── Feature1Model.swift │ └── Feature2Model.swift │ ├── SceneDelegate.swift │ ├── Services │ ├── Feature1Service.swift │ ├── Feature1ServiceImplementation.swift │ ├── Feature1ServiceModel.swift │ ├── Feature2Service.swift │ ├── Feature2ServiceImplementation.swift │ └── Feature2ServiceModel.swift │ ├── UI │ ├── Feature1 │ │ ├── Feature1DependencyContainer.swift │ │ ├── Feature1ViewController.swift │ │ └── Feature1ViewModel.swift │ └── Feature2 │ │ ├── Feature2DependencyContainer.swift │ │ ├── Feature2ViewController.swift │ │ └── Feature2ViewModel.swift │ └── ViewController.swift ├── ModularisationVertical ├── Feature1ExampleApp │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── SceneDelegate.swift │ └── ViewController.swift ├── Feature2ExampleApp │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── SceneDelegate.swift │ └── ViewController.swift ├── ModularisationVertical.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── sashensingh.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── ModularisationVertical.xcscheme │ └── xcuserdata │ │ └── sashensingh.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── ModularisationVertical │ ├── AppDelegate.swift │ ├── AppDependencyContainer.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── Packages │ ├── Feature1Module │ │ ├── .gitignore │ │ ├── .swiftpm │ │ │ └── xcode │ │ │ │ ├── package.xcworkspace │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Feature1Module.xcscheme │ │ ├── Package.swift │ │ ├── README.md │ │ ├── Sources │ │ │ ├── Feature │ │ │ │ ├── Feature1Model.swift │ │ │ │ └── Feature1Service.swift │ │ │ ├── FeatureImplementations │ │ │ │ ├── Feature1ServiceImplementation.swift │ │ │ │ └── Feature1ServiceModel.swift │ │ │ ├── FeatureModule1UI │ │ │ │ ├── Feature1DependencyContainer.swift │ │ │ │ └── Feature1ViewController.swift │ │ │ └── Presentation │ │ │ │ └── Feature1ViewModel.swift │ │ └── Tests │ │ │ └── Feature1ModuleTests │ │ │ └── Feature1ModuleTests.swift │ └── Feature2Module │ │ ├── .gitignore │ │ ├── .swiftpm │ │ └── xcode │ │ │ └── package.xcworkspace │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Package.swift │ │ ├── README.md │ │ ├── Sources │ │ └── Feature2Module │ │ │ ├── Feature Implementations │ │ │ ├── Feature2ServiceImplementation.swift │ │ │ └── Feature2ServiceModel.swift │ │ │ ├── Feature │ │ │ ├── Feature2Model.swift │ │ │ └── Feature2Service.swift │ │ │ ├── Feature2Module.swift │ │ │ ├── Presentation │ │ │ └── Feature2ViewModel.swift │ │ │ └── UI │ │ │ ├── Feature2DependencyContainer.swift │ │ │ └── Feature2ViewController.swift │ │ └── Tests │ │ └── Feature2ModuleTests │ │ └── Feature2ModuleTests.swift │ ├── SceneDelegate.swift │ └── ViewController.swift └── README.md /ModularisationHorizontal/ModularisationHorizontal.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 96EC988E28F2E957001417AB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC988D28F2E957001417AB /* AppDelegate.swift */; }; 11 | 96EC989028F2E957001417AB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC988F28F2E957001417AB /* SceneDelegate.swift */; }; 12 | 96EC989228F2E957001417AB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC989128F2E957001417AB /* ViewController.swift */; }; 13 | 96EC989528F2E957001417AB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96EC989328F2E957001417AB /* Main.storyboard */; }; 14 | 96EC989728F2E959001417AB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96EC989628F2E959001417AB /* Assets.xcassets */; }; 15 | 96EC989A28F2E959001417AB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96EC989828F2E959001417AB /* LaunchScreen.storyboard */; }; 16 | 96EC98C328F2EBE9001417AB /* AppDependencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC98C228F2EBE9001417AB /* AppDependencyContainer.swift */; }; 17 | 96EC98CF28F2EF78001417AB /* Feature in Frameworks */ = {isa = PBXBuildFile; productRef = 96EC98CE28F2EF78001417AB /* Feature */; }; 18 | 96EC98D128F2EF7B001417AB /* FeatureImplementation in Frameworks */ = {isa = PBXBuildFile; productRef = 96EC98D028F2EF7B001417AB /* FeatureImplementation */; }; 19 | 96EC98D628F3044E001417AB /* Presentation in Frameworks */ = {isa = PBXBuildFile; productRef = 96EC98D528F3044E001417AB /* Presentation */; }; 20 | 96EC98DC28F3158B001417AB /* UI in Frameworks */ = {isa = PBXBuildFile; productRef = 96EC98DB28F3158B001417AB /* UI */; }; 21 | 96EC98E428F3183F001417AB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC98E328F3183F001417AB /* AppDelegate.swift */; }; 22 | 96EC98E628F3183F001417AB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC98E528F3183F001417AB /* SceneDelegate.swift */; }; 23 | 96EC98E828F3183F001417AB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC98E728F3183F001417AB /* ViewController.swift */; }; 24 | 96EC98EB28F3183F001417AB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96EC98E928F3183F001417AB /* Main.storyboard */; }; 25 | 96EC98ED28F31841001417AB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96EC98EC28F31841001417AB /* Assets.xcassets */; }; 26 | 96EC98F028F31841001417AB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96EC98EE28F31841001417AB /* LaunchScreen.storyboard */; }; 27 | 96EC98F628F31887001417AB /* ExampleAppDependencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC98F528F31887001417AB /* ExampleAppDependencyContainer.swift */; }; 28 | 96EC98F828F3189A001417AB /* Feature in Frameworks */ = {isa = PBXBuildFile; productRef = 96EC98F728F3189A001417AB /* Feature */; }; 29 | 96EC98FC28F3189A001417AB /* Presentation in Frameworks */ = {isa = PBXBuildFile; productRef = 96EC98FB28F3189A001417AB /* Presentation */; }; 30 | 96EC98FE28F3189A001417AB /* UI in Frameworks */ = {isa = PBXBuildFile; productRef = 96EC98FD28F3189A001417AB /* UI */; }; 31 | 96EC990128F318E0001417AB /* Feature1ServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC990028F318E0001417AB /* Feature1ServiceMock.swift */; }; 32 | 96EC990328F31947001417AB /* Feature2ServiceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EC990228F31947001417AB /* Feature2ServiceMock.swift */; }; 33 | /* End PBXBuildFile section */ 34 | 35 | /* Begin PBXFileReference section */ 36 | 96EC988A28F2E957001417AB /* ModularisationHorizontal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ModularisationHorizontal.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 96EC988D28F2E957001417AB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 38 | 96EC988F28F2E957001417AB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 39 | 96EC989128F2E957001417AB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 40 | 96EC989428F2E957001417AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 96EC989628F2E959001417AB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | 96EC989928F2E959001417AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 43 | 96EC989B28F2E959001417AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 96EC98C228F2EBE9001417AB /* AppDependencyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDependencyContainer.swift; sourceTree = ""; }; 45 | 96EC98CA28F2EF38001417AB /* Feature */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Feature; path = ModularisationHorizontal/Packages/Feature; sourceTree = ""; }; 46 | 96EC98CB28F2EF43001417AB /* FeatureImplementation */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FeatureImplementation; path = ModularisationHorizontal/Packages/FeatureImplementation; sourceTree = ""; }; 47 | 96EC98D428F303A7001417AB /* Presentation */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Presentation; path = ModularisationHorizontal/Packages/Presentation; sourceTree = ""; }; 48 | 96EC98DA28F31584001417AB /* UI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = UI; path = ModularisationHorizontal/Packages/UI; sourceTree = ""; }; 49 | 96EC98E128F3183F001417AB /* UIExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 96EC98E328F3183F001417AB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 51 | 96EC98E528F3183F001417AB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 52 | 96EC98E728F3183F001417AB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 53 | 96EC98EA28F3183F001417AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54 | 96EC98EC28F31841001417AB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 55 | 96EC98EF28F31841001417AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 56 | 96EC98F128F31841001417AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 96EC98F528F31887001417AB /* ExampleAppDependencyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleAppDependencyContainer.swift; sourceTree = ""; }; 58 | 96EC990028F318E0001417AB /* Feature1ServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1ServiceMock.swift; sourceTree = ""; }; 59 | 96EC990228F31947001417AB /* Feature2ServiceMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2ServiceMock.swift; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 96EC988728F2E957001417AB /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 96EC98DC28F3158B001417AB /* UI in Frameworks */, 68 | 96EC98CF28F2EF78001417AB /* Feature in Frameworks */, 69 | 96EC98D628F3044E001417AB /* Presentation in Frameworks */, 70 | 96EC98D128F2EF7B001417AB /* FeatureImplementation in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | 96EC98DE28F3183F001417AB /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | 96EC98FE28F3189A001417AB /* UI in Frameworks */, 79 | 96EC98F828F3189A001417AB /* Feature in Frameworks */, 80 | 96EC98FC28F3189A001417AB /* Presentation in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | 96EC988128F2E957001417AB = { 88 | isa = PBXGroup; 89 | children = ( 90 | 96EC98C428F2EE75001417AB /* Packages */, 91 | 96EC988C28F2E957001417AB /* ModularisationHorizontal */, 92 | 96EC98E228F3183F001417AB /* UIExampleApp */, 93 | 96EC988B28F2E957001417AB /* Products */, 94 | 96EC98C628F2EEC3001417AB /* Frameworks */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 96EC988B28F2E957001417AB /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 96EC988A28F2E957001417AB /* ModularisationHorizontal.app */, 102 | 96EC98E128F3183F001417AB /* UIExampleApp.app */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 96EC988C28F2E957001417AB /* ModularisationHorizontal */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 96EC988D28F2E957001417AB /* AppDelegate.swift */, 111 | 96EC988F28F2E957001417AB /* SceneDelegate.swift */, 112 | 96EC989128F2E957001417AB /* ViewController.swift */, 113 | 96EC989328F2E957001417AB /* Main.storyboard */, 114 | 96EC989628F2E959001417AB /* Assets.xcassets */, 115 | 96EC989828F2E959001417AB /* LaunchScreen.storyboard */, 116 | 96EC989B28F2E959001417AB /* Info.plist */, 117 | 96EC98C228F2EBE9001417AB /* AppDependencyContainer.swift */, 118 | ); 119 | path = ModularisationHorizontal; 120 | sourceTree = ""; 121 | }; 122 | 96EC98C428F2EE75001417AB /* Packages */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 96EC98CA28F2EF38001417AB /* Feature */, 126 | 96EC98CB28F2EF43001417AB /* FeatureImplementation */, 127 | 96EC98D428F303A7001417AB /* Presentation */, 128 | 96EC98DA28F31584001417AB /* UI */, 129 | ); 130 | name = Packages; 131 | sourceTree = ""; 132 | }; 133 | 96EC98C628F2EEC3001417AB /* Frameworks */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | ); 137 | name = Frameworks; 138 | sourceTree = ""; 139 | }; 140 | 96EC98E228F3183F001417AB /* UIExampleApp */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 96EC98FF28F318D6001417AB /* Mocks */, 144 | 96EC98E328F3183F001417AB /* AppDelegate.swift */, 145 | 96EC98E528F3183F001417AB /* SceneDelegate.swift */, 146 | 96EC98E728F3183F001417AB /* ViewController.swift */, 147 | 96EC98E928F3183F001417AB /* Main.storyboard */, 148 | 96EC98EC28F31841001417AB /* Assets.xcassets */, 149 | 96EC98EE28F31841001417AB /* LaunchScreen.storyboard */, 150 | 96EC98F128F31841001417AB /* Info.plist */, 151 | 96EC98F528F31887001417AB /* ExampleAppDependencyContainer.swift */, 152 | ); 153 | path = UIExampleApp; 154 | sourceTree = ""; 155 | }; 156 | 96EC98FF28F318D6001417AB /* Mocks */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 96EC990028F318E0001417AB /* Feature1ServiceMock.swift */, 160 | 96EC990228F31947001417AB /* Feature2ServiceMock.swift */, 161 | ); 162 | path = Mocks; 163 | sourceTree = ""; 164 | }; 165 | /* End PBXGroup section */ 166 | 167 | /* Begin PBXNativeTarget section */ 168 | 96EC988928F2E957001417AB /* ModularisationHorizontal */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = 96EC989E28F2E959001417AB /* Build configuration list for PBXNativeTarget "ModularisationHorizontal" */; 171 | buildPhases = ( 172 | 96EC988628F2E957001417AB /* Sources */, 173 | 96EC988728F2E957001417AB /* Frameworks */, 174 | 96EC988828F2E957001417AB /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | ); 180 | name = ModularisationHorizontal; 181 | packageProductDependencies = ( 182 | 96EC98CE28F2EF78001417AB /* Feature */, 183 | 96EC98D028F2EF7B001417AB /* FeatureImplementation */, 184 | 96EC98D528F3044E001417AB /* Presentation */, 185 | 96EC98DB28F3158B001417AB /* UI */, 186 | ); 187 | productName = ModularisationHorizontal; 188 | productReference = 96EC988A28F2E957001417AB /* ModularisationHorizontal.app */; 189 | productType = "com.apple.product-type.application"; 190 | }; 191 | 96EC98E028F3183F001417AB /* UIExampleApp */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 96EC98F428F31841001417AB /* Build configuration list for PBXNativeTarget "UIExampleApp" */; 194 | buildPhases = ( 195 | 96EC98DD28F3183F001417AB /* Sources */, 196 | 96EC98DE28F3183F001417AB /* Frameworks */, 197 | 96EC98DF28F3183F001417AB /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | ); 203 | name = UIExampleApp; 204 | packageProductDependencies = ( 205 | 96EC98F728F3189A001417AB /* Feature */, 206 | 96EC98FB28F3189A001417AB /* Presentation */, 207 | 96EC98FD28F3189A001417AB /* UI */, 208 | ); 209 | productName = UIExampleApp; 210 | productReference = 96EC98E128F3183F001417AB /* UIExampleApp.app */; 211 | productType = "com.apple.product-type.application"; 212 | }; 213 | /* End PBXNativeTarget section */ 214 | 215 | /* Begin PBXProject section */ 216 | 96EC988228F2E957001417AB /* Project object */ = { 217 | isa = PBXProject; 218 | attributes = { 219 | BuildIndependentTargetsInParallel = 1; 220 | LastSwiftUpdateCheck = 1340; 221 | LastUpgradeCheck = 1340; 222 | TargetAttributes = { 223 | 96EC988928F2E957001417AB = { 224 | CreatedOnToolsVersion = 13.4.1; 225 | }; 226 | 96EC98E028F3183F001417AB = { 227 | CreatedOnToolsVersion = 13.4.1; 228 | }; 229 | }; 230 | }; 231 | buildConfigurationList = 96EC988528F2E957001417AB /* Build configuration list for PBXProject "ModularisationHorizontal" */; 232 | compatibilityVersion = "Xcode 13.0"; 233 | developmentRegion = en; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | Base, 238 | ); 239 | mainGroup = 96EC988128F2E957001417AB; 240 | productRefGroup = 96EC988B28F2E957001417AB /* Products */; 241 | projectDirPath = ""; 242 | projectRoot = ""; 243 | targets = ( 244 | 96EC988928F2E957001417AB /* ModularisationHorizontal */, 245 | 96EC98E028F3183F001417AB /* UIExampleApp */, 246 | ); 247 | }; 248 | /* End PBXProject section */ 249 | 250 | /* Begin PBXResourcesBuildPhase section */ 251 | 96EC988828F2E957001417AB /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | 96EC989A28F2E959001417AB /* LaunchScreen.storyboard in Resources */, 256 | 96EC989728F2E959001417AB /* Assets.xcassets in Resources */, 257 | 96EC989528F2E957001417AB /* Main.storyboard in Resources */, 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | 96EC98DF28F3183F001417AB /* Resources */ = { 262 | isa = PBXResourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | 96EC98F028F31841001417AB /* LaunchScreen.storyboard in Resources */, 266 | 96EC98ED28F31841001417AB /* Assets.xcassets in Resources */, 267 | 96EC98EB28F3183F001417AB /* Main.storyboard in Resources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | /* End PBXResourcesBuildPhase section */ 272 | 273 | /* Begin PBXSourcesBuildPhase section */ 274 | 96EC988628F2E957001417AB /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 96EC989228F2E957001417AB /* ViewController.swift in Sources */, 279 | 96EC988E28F2E957001417AB /* AppDelegate.swift in Sources */, 280 | 96EC989028F2E957001417AB /* SceneDelegate.swift in Sources */, 281 | 96EC98C328F2EBE9001417AB /* AppDependencyContainer.swift in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | 96EC98DD28F3183F001417AB /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 96EC98E828F3183F001417AB /* ViewController.swift in Sources */, 290 | 96EC990328F31947001417AB /* Feature2ServiceMock.swift in Sources */, 291 | 96EC990128F318E0001417AB /* Feature1ServiceMock.swift in Sources */, 292 | 96EC98F628F31887001417AB /* ExampleAppDependencyContainer.swift in Sources */, 293 | 96EC98E428F3183F001417AB /* AppDelegate.swift in Sources */, 294 | 96EC98E628F3183F001417AB /* SceneDelegate.swift in Sources */, 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXSourcesBuildPhase section */ 299 | 300 | /* Begin PBXVariantGroup section */ 301 | 96EC989328F2E957001417AB /* Main.storyboard */ = { 302 | isa = PBXVariantGroup; 303 | children = ( 304 | 96EC989428F2E957001417AB /* Base */, 305 | ); 306 | name = Main.storyboard; 307 | sourceTree = ""; 308 | }; 309 | 96EC989828F2E959001417AB /* LaunchScreen.storyboard */ = { 310 | isa = PBXVariantGroup; 311 | children = ( 312 | 96EC989928F2E959001417AB /* Base */, 313 | ); 314 | name = LaunchScreen.storyboard; 315 | sourceTree = ""; 316 | }; 317 | 96EC98E928F3183F001417AB /* Main.storyboard */ = { 318 | isa = PBXVariantGroup; 319 | children = ( 320 | 96EC98EA28F3183F001417AB /* Base */, 321 | ); 322 | name = Main.storyboard; 323 | sourceTree = ""; 324 | }; 325 | 96EC98EE28F31841001417AB /* LaunchScreen.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | 96EC98EF28F31841001417AB /* Base */, 329 | ); 330 | name = LaunchScreen.storyboard; 331 | sourceTree = ""; 332 | }; 333 | /* End PBXVariantGroup section */ 334 | 335 | /* Begin XCBuildConfiguration section */ 336 | 96EC989C28F2E959001417AB /* Debug */ = { 337 | isa = XCBuildConfiguration; 338 | buildSettings = { 339 | ALWAYS_SEARCH_USER_PATHS = NO; 340 | CLANG_ANALYZER_NONNULL = YES; 341 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 343 | CLANG_ENABLE_MODULES = YES; 344 | CLANG_ENABLE_OBJC_ARC = YES; 345 | CLANG_ENABLE_OBJC_WEAK = YES; 346 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 347 | CLANG_WARN_BOOL_CONVERSION = YES; 348 | CLANG_WARN_COMMA = YES; 349 | CLANG_WARN_CONSTANT_CONVERSION = YES; 350 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 351 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 352 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 353 | CLANG_WARN_EMPTY_BODY = YES; 354 | CLANG_WARN_ENUM_CONVERSION = YES; 355 | CLANG_WARN_INFINITE_RECURSION = YES; 356 | CLANG_WARN_INT_CONVERSION = YES; 357 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 358 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 359 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 362 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 363 | CLANG_WARN_STRICT_PROTOTYPES = YES; 364 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 365 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 366 | CLANG_WARN_UNREACHABLE_CODE = YES; 367 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 368 | COPY_PHASE_STRIP = NO; 369 | DEBUG_INFORMATION_FORMAT = dwarf; 370 | ENABLE_STRICT_OBJC_MSGSEND = YES; 371 | ENABLE_TESTABILITY = YES; 372 | GCC_C_LANGUAGE_STANDARD = gnu11; 373 | GCC_DYNAMIC_NO_PIC = NO; 374 | GCC_NO_COMMON_BLOCKS = YES; 375 | GCC_OPTIMIZATION_LEVEL = 0; 376 | GCC_PREPROCESSOR_DEFINITIONS = ( 377 | "DEBUG=1", 378 | "$(inherited)", 379 | ); 380 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 381 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 382 | GCC_WARN_UNDECLARED_SELECTOR = YES; 383 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 384 | GCC_WARN_UNUSED_FUNCTION = YES; 385 | GCC_WARN_UNUSED_VARIABLE = YES; 386 | IPHONEOS_DEPLOYMENT_TARGET = 15.5; 387 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 388 | MTL_FAST_MATH = YES; 389 | ONLY_ACTIVE_ARCH = YES; 390 | SDKROOT = iphoneos; 391 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 392 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 393 | }; 394 | name = Debug; 395 | }; 396 | 96EC989D28F2E959001417AB /* Release */ = { 397 | isa = XCBuildConfiguration; 398 | buildSettings = { 399 | ALWAYS_SEARCH_USER_PATHS = NO; 400 | CLANG_ANALYZER_NONNULL = YES; 401 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 403 | CLANG_ENABLE_MODULES = YES; 404 | CLANG_ENABLE_OBJC_ARC = YES; 405 | CLANG_ENABLE_OBJC_WEAK = YES; 406 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 407 | CLANG_WARN_BOOL_CONVERSION = YES; 408 | CLANG_WARN_COMMA = YES; 409 | CLANG_WARN_CONSTANT_CONVERSION = YES; 410 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 411 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 412 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 413 | CLANG_WARN_EMPTY_BODY = YES; 414 | CLANG_WARN_ENUM_CONVERSION = YES; 415 | CLANG_WARN_INFINITE_RECURSION = YES; 416 | CLANG_WARN_INT_CONVERSION = YES; 417 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 418 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 419 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 420 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 421 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 422 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 423 | CLANG_WARN_STRICT_PROTOTYPES = YES; 424 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 425 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 426 | CLANG_WARN_UNREACHABLE_CODE = YES; 427 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 428 | COPY_PHASE_STRIP = NO; 429 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 430 | ENABLE_NS_ASSERTIONS = NO; 431 | ENABLE_STRICT_OBJC_MSGSEND = YES; 432 | GCC_C_LANGUAGE_STANDARD = gnu11; 433 | GCC_NO_COMMON_BLOCKS = YES; 434 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 435 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 436 | GCC_WARN_UNDECLARED_SELECTOR = YES; 437 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 438 | GCC_WARN_UNUSED_FUNCTION = YES; 439 | GCC_WARN_UNUSED_VARIABLE = YES; 440 | IPHONEOS_DEPLOYMENT_TARGET = 15.5; 441 | MTL_ENABLE_DEBUG_INFO = NO; 442 | MTL_FAST_MATH = YES; 443 | SDKROOT = iphoneos; 444 | SWIFT_COMPILATION_MODE = wholemodule; 445 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 446 | VALIDATE_PRODUCT = YES; 447 | }; 448 | name = Release; 449 | }; 450 | 96EC989F28F2E959001417AB /* Debug */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 454 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 455 | CODE_SIGN_STYLE = Automatic; 456 | CURRENT_PROJECT_VERSION = 1; 457 | DEVELOPMENT_TEAM = ""; 458 | GENERATE_INFOPLIST_FILE = YES; 459 | INFOPLIST_FILE = ModularisationHorizontal/Info.plist; 460 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 461 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 462 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 463 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 464 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 465 | LD_RUNPATH_SEARCH_PATHS = ( 466 | "$(inherited)", 467 | "@executable_path/Frameworks", 468 | ); 469 | MARKETING_VERSION = 1.0; 470 | PRODUCT_BUNDLE_IDENTIFIER = sashensingh.ModularisationHorizontal; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | SWIFT_EMIT_LOC_STRINGS = YES; 473 | SWIFT_VERSION = 5.0; 474 | TARGETED_DEVICE_FAMILY = "1,2"; 475 | }; 476 | name = Debug; 477 | }; 478 | 96EC98A028F2E959001417AB /* Release */ = { 479 | isa = XCBuildConfiguration; 480 | buildSettings = { 481 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 482 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 483 | CODE_SIGN_STYLE = Automatic; 484 | CURRENT_PROJECT_VERSION = 1; 485 | DEVELOPMENT_TEAM = ""; 486 | GENERATE_INFOPLIST_FILE = YES; 487 | INFOPLIST_FILE = ModularisationHorizontal/Info.plist; 488 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 489 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 490 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 491 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 492 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 493 | LD_RUNPATH_SEARCH_PATHS = ( 494 | "$(inherited)", 495 | "@executable_path/Frameworks", 496 | ); 497 | MARKETING_VERSION = 1.0; 498 | PRODUCT_BUNDLE_IDENTIFIER = sashensingh.ModularisationHorizontal; 499 | PRODUCT_NAME = "$(TARGET_NAME)"; 500 | SWIFT_EMIT_LOC_STRINGS = YES; 501 | SWIFT_VERSION = 5.0; 502 | TARGETED_DEVICE_FAMILY = "1,2"; 503 | }; 504 | name = Release; 505 | }; 506 | 96EC98F228F31841001417AB /* Debug */ = { 507 | isa = XCBuildConfiguration; 508 | buildSettings = { 509 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 510 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 511 | CODE_SIGN_STYLE = Automatic; 512 | CURRENT_PROJECT_VERSION = 1; 513 | DEVELOPMENT_TEAM = ""; 514 | GENERATE_INFOPLIST_FILE = YES; 515 | INFOPLIST_FILE = UIExampleApp/Info.plist; 516 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 517 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 518 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 519 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 520 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 521 | LD_RUNPATH_SEARCH_PATHS = ( 522 | "$(inherited)", 523 | "@executable_path/Frameworks", 524 | ); 525 | MARKETING_VERSION = 1.0; 526 | PRODUCT_BUNDLE_IDENTIFIER = sashensingh.UIExampleApp; 527 | PRODUCT_NAME = "$(TARGET_NAME)"; 528 | SWIFT_EMIT_LOC_STRINGS = YES; 529 | SWIFT_VERSION = 5.0; 530 | TARGETED_DEVICE_FAMILY = "1,2"; 531 | }; 532 | name = Debug; 533 | }; 534 | 96EC98F328F31841001417AB /* Release */ = { 535 | isa = XCBuildConfiguration; 536 | buildSettings = { 537 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 538 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 539 | CODE_SIGN_STYLE = Automatic; 540 | CURRENT_PROJECT_VERSION = 1; 541 | DEVELOPMENT_TEAM = ""; 542 | GENERATE_INFOPLIST_FILE = YES; 543 | INFOPLIST_FILE = UIExampleApp/Info.plist; 544 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 545 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 546 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 547 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 548 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 549 | LD_RUNPATH_SEARCH_PATHS = ( 550 | "$(inherited)", 551 | "@executable_path/Frameworks", 552 | ); 553 | MARKETING_VERSION = 1.0; 554 | PRODUCT_BUNDLE_IDENTIFIER = sashensingh.UIExampleApp; 555 | PRODUCT_NAME = "$(TARGET_NAME)"; 556 | SWIFT_EMIT_LOC_STRINGS = YES; 557 | SWIFT_VERSION = 5.0; 558 | TARGETED_DEVICE_FAMILY = "1,2"; 559 | }; 560 | name = Release; 561 | }; 562 | /* End XCBuildConfiguration section */ 563 | 564 | /* Begin XCConfigurationList section */ 565 | 96EC988528F2E957001417AB /* Build configuration list for PBXProject "ModularisationHorizontal" */ = { 566 | isa = XCConfigurationList; 567 | buildConfigurations = ( 568 | 96EC989C28F2E959001417AB /* Debug */, 569 | 96EC989D28F2E959001417AB /* Release */, 570 | ); 571 | defaultConfigurationIsVisible = 0; 572 | defaultConfigurationName = Release; 573 | }; 574 | 96EC989E28F2E959001417AB /* Build configuration list for PBXNativeTarget "ModularisationHorizontal" */ = { 575 | isa = XCConfigurationList; 576 | buildConfigurations = ( 577 | 96EC989F28F2E959001417AB /* Debug */, 578 | 96EC98A028F2E959001417AB /* Release */, 579 | ); 580 | defaultConfigurationIsVisible = 0; 581 | defaultConfigurationName = Release; 582 | }; 583 | 96EC98F428F31841001417AB /* Build configuration list for PBXNativeTarget "UIExampleApp" */ = { 584 | isa = XCConfigurationList; 585 | buildConfigurations = ( 586 | 96EC98F228F31841001417AB /* Debug */, 587 | 96EC98F328F31841001417AB /* Release */, 588 | ); 589 | defaultConfigurationIsVisible = 0; 590 | defaultConfigurationName = Release; 591 | }; 592 | /* End XCConfigurationList section */ 593 | 594 | /* Begin XCSwiftPackageProductDependency section */ 595 | 96EC98CE28F2EF78001417AB /* Feature */ = { 596 | isa = XCSwiftPackageProductDependency; 597 | productName = Feature; 598 | }; 599 | 96EC98D028F2EF7B001417AB /* FeatureImplementation */ = { 600 | isa = XCSwiftPackageProductDependency; 601 | productName = FeatureImplementation; 602 | }; 603 | 96EC98D528F3044E001417AB /* Presentation */ = { 604 | isa = XCSwiftPackageProductDependency; 605 | productName = Presentation; 606 | }; 607 | 96EC98DB28F3158B001417AB /* UI */ = { 608 | isa = XCSwiftPackageProductDependency; 609 | productName = UI; 610 | }; 611 | 96EC98F728F3189A001417AB /* Feature */ = { 612 | isa = XCSwiftPackageProductDependency; 613 | productName = Feature; 614 | }; 615 | 96EC98FB28F3189A001417AB /* Presentation */ = { 616 | isa = XCSwiftPackageProductDependency; 617 | productName = Presentation; 618 | }; 619 | 96EC98FD28F3189A001417AB /* UI */ = { 620 | isa = XCSwiftPackageProductDependency; 621 | productName = UI; 622 | }; 623 | /* End XCSwiftPackageProductDependency section */ 624 | }; 625 | rootObject = 96EC988228F2E957001417AB /* Project object */; 626 | } 627 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal.xcodeproj/project.xcworkspace/xcuserdata/sashensingh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SashenSinghDev/ModularisationExample/3cbfe3c547601f5c4b1151f02b6262ebfae8b38f/ModularisationHorizontal/ModularisationHorizontal.xcodeproj/project.xcworkspace/xcuserdata/sashensingh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal.xcodeproj/xcshareddata/xcschemes/ModularisationHorizontal.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal.xcodeproj/xcuserdata/sashensingh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ModularisationHorizontal.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 3 11 | 12 | UIExampleApp.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 5 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 96EC988928F2E957001417AB 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/AppDependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDependencyContainer.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import FeatureImplementation 11 | import Presentation 12 | import UI 13 | 14 | final class AppDependencyContainer { 15 | 16 | let feature1ViewController: UIViewController 17 | let feature2ViewController: UIViewController 18 | 19 | init() { 20 | 21 | func makeFeature1ViewController() -> UIViewController { 22 | let feature1DependencyContainer = Feature1DependencyContainer(feature1Service: Feature1ServiceImplementation()) 23 | return feature1DependencyContainer.makeFeature1ViewController() 24 | } 25 | 26 | func makeFeature2ViewController() -> UIViewController { 27 | let feature2DependencyContainer = Feature2DependencyContainer(feature2Service: Feature2ServiceImplementation()) 28 | return feature2DependencyContainer.makeFeature2ViewController() 29 | } 30 | 31 | feature1ViewController = makeFeature1ViewController() 32 | feature2ViewController = makeFeature2ViewController() 33 | } 34 | 35 | func makeMainViewController() -> UITabBarController { 36 | let tabViewController = UITabBarController() 37 | 38 | feature1ViewController.tabBarItem = UITabBarItem(title: "feature1", 39 | image: nil, selectedImage: nil) 40 | 41 | feature2ViewController.tabBarItem = UITabBarItem(title: "feature2", 42 | image: nil, selectedImage: nil) 43 | 44 | tabViewController.tabBar.isTranslucent = false 45 | tabViewController.tabBar.backgroundColor = .white 46 | 47 | tabViewController.viewControllers = [feature1ViewController, 48 | feature2ViewController] 49 | return tabViewController 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "2x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "83.5x83.5" 82 | }, 83 | { 84 | "idiom" : "ios-marketing", 85 | "scale" : "1x", 86 | "size" : "1024x1024" 87 | } 88 | ], 89 | "info" : { 90 | "author" : "xcode", 91 | "version" : 1 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/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 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/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 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/.swiftpm/xcode/xcshareddata/xcschemes/Feature.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Feature", 8 | platforms: [.iOS(.v15)], 9 | products: [ 10 | // Products define the executables and libraries a package produces, and make them visible to other packages. 11 | .library( 12 | name: "Feature", 13 | targets: ["Feature"]), 14 | ], 15 | dependencies: [ 16 | // Dependencies declare other packages that this package depends on. 17 | // .package(url: /* package url */, from: "1.0.0"), 18 | ], 19 | targets: [ 20 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 21 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 22 | .target( 23 | name: "Feature", 24 | dependencies: []), 25 | .testTarget( 26 | name: "FeatureTests", 27 | dependencies: ["Feature"]), 28 | ] 29 | ) 30 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/README.md: -------------------------------------------------------------------------------- 1 | # Feature 2 | 3 | A description of this package. 4 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/Sources/Feature/Feature1/Feature1Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1Model.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | 10 | public struct Feature1Model { 11 | public let data: String 12 | 13 | public init(data: String) { 14 | self.data = data 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/Sources/Feature/Feature1/Feature1Service.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1Service.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | 10 | public protocol Feature1Service { 11 | func fetchData(completion: @escaping (Feature1Model) -> ()) 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/Sources/Feature/Feature2/Feature2Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2Model.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | 10 | public struct Feature2Model { 11 | public let data: String 12 | 13 | public init(data: String) { 14 | self.data = data 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/Sources/Feature/Feature2/Feature2Service.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2Service.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | 10 | public protocol Feature2Service { 11 | func fetchData(completion: @escaping (Feature2Model) -> ()) 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Feature/Tests/FeatureTests/FeatureTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import Feature 3 | 4 | final class FeatureTests: XCTestCase { 5 | func testExample() throws { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(Feature().text, "Hello, World!") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/.swiftpm/xcode/xcshareddata/xcschemes/FeatureImplementation.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "FeatureImplementation", 8 | platforms: [.iOS(.v15)], 9 | products: [ 10 | // Products define the executables and libraries a package produces, and make them visible to other packages. 11 | .library( 12 | name: "FeatureImplementation", 13 | targets: ["FeatureImplementation"]), 14 | ], 15 | dependencies: [ 16 | // Dependencies declare other packages that this package depends on. 17 | // .package(url: /* package url */, from: "1.0.0"), 18 | .package(path: "../Feature") 19 | ], 20 | targets: [ 21 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 22 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 23 | .target( 24 | name: "FeatureImplementation", 25 | dependencies: ["Feature"]), 26 | .testTarget( 27 | name: "FeatureImplementationTests", 28 | dependencies: ["FeatureImplementation"]), 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/README.md: -------------------------------------------------------------------------------- 1 | # FeatureImplementation 2 | 3 | A description of this package. 4 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/Sources/FeatureImplementation/Feature1/Feature1ServiceImplementation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ServiceImplementation.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import Feature 10 | 11 | public final class Feature1ServiceImplementation: Feature1Service { 12 | public init() {} 13 | public func fetchData(completion: @escaping (Feature1Model) -> ()) { 14 | let serviceModel = Feature1ServiceModel(data: "Feature1Data") 15 | let mappedFeatureModel = Feature1Model(feature1ServiceModel: serviceModel) 16 | completion(mappedFeatureModel) 17 | } 18 | } 19 | 20 | private extension Feature1Model { 21 | init(feature1ServiceModel: Feature1ServiceModel) { 22 | self.init(data: feature1ServiceModel.data) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/Sources/FeatureImplementation/Feature1/Feature1ServiceModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ServiceModel.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature1ServiceModel { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/Sources/FeatureImplementation/Feature2/Feature2ServiceImplementation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ServiceImplementation.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import Feature 10 | 11 | public final class Feature2ServiceImplementation: Feature2Service { 12 | public init() { 13 | } 14 | 15 | public func fetchData(completion: @escaping (Feature2Model) -> ()) { 16 | let serviceModel = Feature2ServiceModel(data: "Feature2Data") 17 | let mappedFeatureModel = Feature2Model(feature2ServiceModel: serviceModel) 18 | 19 | completion(mappedFeatureModel) 20 | } 21 | } 22 | 23 | private extension Feature2Model { 24 | init(feature2ServiceModel: Feature2ServiceModel) { 25 | self.init(data: feature2ServiceModel.data) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/Sources/FeatureImplementation/Feature2/Feature2ServiceModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ServiceModel.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature2ServiceModel { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/FeatureImplementation/Tests/FeatureImplementationTests/FeatureImplementationTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import FeatureImplementation 3 | 4 | final class FeatureImplementationTests: XCTestCase { 5 | func testExample() throws { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(FeatureImplementation().text, "Hello, World!") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/.swiftpm/xcode/xcshareddata/xcschemes/Presentation.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Presentation", 8 | platforms: [.iOS(.v15)], 9 | products: [ 10 | // Products define the executables and libraries a package produces, and make them visible to other packages. 11 | .library( 12 | name: "Presentation", 13 | targets: ["Presentation"]), 14 | ], 15 | dependencies: [ 16 | // Dependencies declare other packages that this package depends on. 17 | // .package(url: /* package url */, from: "1.0.0"), 18 | .package(path: "../Feature") 19 | ], 20 | targets: [ 21 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 22 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 23 | .target( 24 | name: "Presentation", 25 | dependencies: ["Feature"]), 26 | .testTarget( 27 | name: "PresentationTests", 28 | dependencies: ["Presentation"]), 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/README.md: -------------------------------------------------------------------------------- 1 | # Presentation 2 | 3 | A description of this package. 4 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/Sources/Presentation/Feature1/Feature1ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ViewModel.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | import Feature 8 | 9 | public enum ViewStateFeature1 { 10 | case initial 11 | case loadedData(dataValue: String) 12 | } 13 | 14 | public final class Feature1ViewModel { 15 | private let service: Feature1Service 16 | 17 | public var stateChanged: (ViewStateFeature1) -> Void = { _ in } 18 | 19 | public init(service: Feature1Service) { 20 | self.service = service 21 | } 22 | 23 | public func loadData() { 24 | service.fetchData { [weak self] modelData in 25 | guard let self = self else { return } 26 | 27 | self.stateChanged(.loadedData(dataValue: modelData.data)) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/Sources/Presentation/Feature2/Feature2ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ViewModel.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import Feature 10 | 11 | public enum ViewStateFeature2 { 12 | case initial 13 | case loadedData(Feature2Model) 14 | } 15 | 16 | public final class Feature2ViewModel { 17 | private let service: Feature2Service 18 | 19 | public var stateChanged: (ViewStateFeature2) -> Void = { _ in } 20 | 21 | public init(service: Feature2Service) { 22 | self.service = service 23 | } 24 | 25 | public func loadData() { 26 | service.fetchData { [weak self] modelData in 27 | guard let self = self else { return } 28 | 29 | self.stateChanged(.loadedData(modelData)) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/Presentation/Tests/PresentationTests/PresentationTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import Presentation 3 | 4 | final class PresentationTests: XCTestCase { 5 | func testExample() throws { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(Presentation().text, "Hello, World!") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/.swiftpm/xcode/xcshareddata/xcschemes/UI.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "UI", 8 | platforms: [.iOS(.v15)], 9 | products: [ 10 | // Products define the executables and libraries a package produces, and make them visible to other packages. 11 | .library( 12 | name: "UI", 13 | targets: ["UI"]), 14 | ], 15 | dependencies: [ 16 | // Dependencies declare other packages that this package depends on. 17 | // .package(url: /* package url */, from: "1.0.0"), 18 | .package(path: "../Presentation"), 19 | .package(path: "../Feature") 20 | ], 21 | targets: [ 22 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 23 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 24 | .target( 25 | name: "UI", 26 | dependencies: ["Presentation", "Feature"]), 27 | .testTarget( 28 | name: "UITests", 29 | dependencies: ["UI"]), 30 | ] 31 | ) 32 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/README.md: -------------------------------------------------------------------------------- 1 | # UI 2 | 3 | A description of this package. 4 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/Sources/UI/Feature1/Feature1DependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1DependencyContainer.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import Feature 11 | import Presentation 12 | 13 | public final class Feature1DependencyContainer { 14 | 15 | private let feature1ViewModel: Feature1ViewModel 16 | 17 | public init(feature1Service: Feature1Service) { 18 | func makeFeature1ViewModel() -> Feature1ViewModel { 19 | return Feature1ViewModel(service: feature1Service) 20 | } 21 | 22 | feature1ViewModel = makeFeature1ViewModel() 23 | } 24 | 25 | public func makeFeature1ViewController() -> UIViewController { 26 | let feature1ViewController = Feature1ViewController(viewModel: feature1ViewModel) 27 | return feature1ViewController 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/Sources/UI/Feature1/Feature1ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ViewController.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import Presentation 11 | 12 | public final class Feature1ViewController: UIViewController { 13 | 14 | private var viewModel: Feature1ViewModel 15 | private let dataLabel: UILabel = { 16 | let label = UILabel() 17 | return label 18 | }() 19 | 20 | init(viewModel: Feature1ViewModel) { 21 | self.viewModel = viewModel 22 | 23 | super.init(nibName: nil, bundle: nil) 24 | } 25 | 26 | required init?(coder: NSCoder) { 27 | fatalError("init(coder:) has not been implemented") 28 | } 29 | 30 | public override func viewDidLoad() { 31 | view.backgroundColor = .red 32 | 33 | addLabel() 34 | bindToViewModel() 35 | viewModel.loadData() 36 | } 37 | 38 | private func bindToViewModel() { 39 | viewModel.stateChanged = { [weak self] state in 40 | guard let self = self else { return } 41 | 42 | switch state { 43 | case .initial: 44 | break 45 | case .loadedData(let dataValue): 46 | self.dataLabel.text = dataValue 47 | } 48 | } 49 | } 50 | 51 | private func addLabel() { 52 | view.addSubview(dataLabel) 53 | dataLabel.translatesAutoresizingMaskIntoConstraints = false 54 | dataLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true 55 | dataLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/Sources/UI/Feature2/Feature2DependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2DependencyContainer.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import Presentation 11 | import Feature 12 | 13 | public final class Feature2DependencyContainer { 14 | 15 | private let feature2ViewModel: Feature2ViewModel 16 | 17 | public init(feature2Service: Feature2Service) { 18 | func makeFeature2ViewModel() -> Feature2ViewModel { 19 | return Feature2ViewModel(service: feature2Service) 20 | } 21 | 22 | feature2ViewModel = makeFeature2ViewModel() 23 | } 24 | 25 | public func makeFeature2ViewController() -> UIViewController { 26 | let feature2ViewController = Feature2ViewController(viewModel: feature2ViewModel) 27 | return feature2ViewController 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/Sources/UI/Feature2/Feature2ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ViewController.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import Presentation 11 | 12 | public final class Feature2ViewController: UIViewController { 13 | 14 | private var viewModel: Feature2ViewModel 15 | private let dataLabel: UILabel = { 16 | let label = UILabel() 17 | return label 18 | }() 19 | 20 | init(viewModel: Feature2ViewModel) { 21 | self.viewModel = viewModel 22 | 23 | super.init(nibName: nil, bundle: nil) 24 | } 25 | 26 | required init?(coder: NSCoder) { 27 | fatalError("init(coder:) has not been implemented") 28 | } 29 | 30 | public override func viewDidLoad() { 31 | view.backgroundColor = .blue 32 | 33 | addLabel() 34 | bindToViewModel() 35 | viewModel.loadData() 36 | } 37 | 38 | private func bindToViewModel() { 39 | viewModel.stateChanged = { [weak self] state in 40 | guard let self = self else { return } 41 | 42 | switch state { 43 | case .initial: 44 | break 45 | case .loadedData(let model): 46 | self.dataLabel.text = model.data 47 | } 48 | } 49 | } 50 | 51 | private func addLabel() { 52 | view.addSubview(dataLabel) 53 | dataLabel.translatesAutoresizingMaskIntoConstraints = false 54 | dataLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true 55 | dataLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/Sources/UI/UI.swift: -------------------------------------------------------------------------------- 1 | public struct UI { 2 | public private(set) var text = "Hello, World!" 3 | 4 | public init() { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/Packages/UI/Tests/UITests/UITests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import UI 3 | 4 | final class UITests: XCTestCase { 5 | func testExample() throws { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(UI().text, "Hello, World!") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | 21 | let appDependancyContainer = AppDependencyContainer() 22 | 23 | window?.backgroundColor = .clear 24 | window?.rootViewController = appDependancyContainer.makeMainViewController() 25 | } 26 | 27 | func sceneDidDisconnect(_ scene: UIScene) { 28 | // Called as the scene is being released by the system. 29 | // This occurs shortly after the scene enters the background, or when its session is discarded. 30 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 31 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 32 | } 33 | 34 | func sceneDidBecomeActive(_ scene: UIScene) { 35 | // Called when the scene has moved from an inactive state to an active state. 36 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 37 | } 38 | 39 | func sceneWillResignActive(_ scene: UIScene) { 40 | // Called when the scene will move from an active state to an inactive state. 41 | // This may occur due to temporary interruptions (ex. an incoming phone call). 42 | } 43 | 44 | func sceneWillEnterForeground(_ scene: UIScene) { 45 | // Called as the scene transitions from the background to the foreground. 46 | // Use this method to undo the changes made on entering the background. 47 | } 48 | 49 | func sceneDidEnterBackground(_ scene: UIScene) { 50 | // Called as the scene transitions from the foreground to the background. 51 | // Use this method to save data, release shared resources, and store enough scene-specific state information 52 | // to restore the scene back to its current state. 53 | } 54 | 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /ModularisationHorizontal/ModularisationHorizontal/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ModularisationHorizontal 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | class ViewController: UIViewController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | // Do any additional setup after loading the view. 15 | } 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // UIExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "2x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "83.5x83.5" 82 | }, 83 | { 84 | "idiom" : "ios-marketing", 85 | "scale" : "1x", 86 | "size" : "1024x1024" 87 | } 88 | ], 89 | "info" : { 90 | "author" : "xcode", 91 | "version" : 1 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/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 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/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 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/ExampleAppDependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleAppDependencyContainer.swift 3 | // UIExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import Presentation 11 | import UI 12 | 13 | final class ExampleAppDependencyContainer { 14 | 15 | let feature1ViewController: UIViewController 16 | let feature2ViewController: UIViewController 17 | 18 | init() { 19 | 20 | func makeFeature1ViewController() -> UIViewController { 21 | let feature1DependencyContainer = Feature1DependencyContainer(feature1Service: Feature1ServiceMock()) 22 | return feature1DependencyContainer.makeFeature1ViewController() 23 | } 24 | 25 | func makeFeature2ViewController() -> UIViewController { 26 | let feature2DependencyContainer = Feature2DependencyContainer(feature2Service: Feature2ServiceMock()) 27 | return feature2DependencyContainer.makeFeature2ViewController() 28 | } 29 | 30 | feature1ViewController = makeFeature1ViewController() 31 | feature2ViewController = makeFeature2ViewController() 32 | } 33 | 34 | func makeMainViewController() -> UITabBarController { 35 | let tabViewController = UITabBarController() 36 | 37 | feature1ViewController.tabBarItem = UITabBarItem(title: "feature1", 38 | image: nil, selectedImage: nil) 39 | 40 | feature2ViewController.tabBarItem = UITabBarItem(title: "feature2", 41 | image: nil, selectedImage: nil) 42 | 43 | tabViewController.tabBar.isTranslucent = false 44 | tabViewController.tabBar.backgroundColor = .white 45 | 46 | tabViewController.viewControllers = [feature1ViewController, 47 | feature2ViewController] 48 | return tabViewController 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/Mocks/Feature1ServiceMock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ServiceMock.swift 3 | // UIExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import Feature 10 | 11 | public final class Feature1ServiceMock: Feature1Service { 12 | public func fetchData(completion: @escaping (Feature1Model) -> ()) { 13 | let feature1ModelStub = Feature1Model(data: "ExampleFeature1Data") 14 | completion(feature1ModelStub) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/Mocks/Feature2ServiceMock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ServiceMock.swift 3 | // UIExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import Foundation 9 | import Feature 10 | 11 | public final class Feature2ServiceMock: Feature2Service { 12 | public func fetchData(completion: @escaping (Feature2Model) -> ()) { 13 | let feature2ModelStub = Feature2Model(data: "ExampleFeature2Data") 14 | completion(feature2ModelStub) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // UIExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | 21 | let appDependancyContainer = ExampleAppDependencyContainer() 22 | 23 | window?.backgroundColor = .clear 24 | window?.rootViewController = appDependancyContainer.makeMainViewController() 25 | } 26 | 27 | func sceneDidDisconnect(_ scene: UIScene) { 28 | // Called as the scene is being released by the system. 29 | // This occurs shortly after the scene enters the background, or when its session is discarded. 30 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 31 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 32 | } 33 | 34 | func sceneDidBecomeActive(_ scene: UIScene) { 35 | // Called when the scene has moved from an inactive state to an active state. 36 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 37 | } 38 | 39 | func sceneWillResignActive(_ scene: UIScene) { 40 | // Called when the scene will move from an active state to an inactive state. 41 | // This may occur due to temporary interruptions (ex. an incoming phone call). 42 | } 43 | 44 | func sceneWillEnterForeground(_ scene: UIScene) { 45 | // Called as the scene transitions from the background to the foreground. 46 | // Use this method to undo the changes made on entering the background. 47 | } 48 | 49 | func sceneDidEnterBackground(_ scene: UIScene) { 50 | // Called as the scene transitions from the foreground to the background. 51 | // Use this method to save data, release shared resources, and store enough scene-specific state information 52 | // to restore the scene back to its current state. 53 | } 54 | 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /ModularisationHorizontal/UIExampleApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // UIExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | class ViewController: UIViewController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | // Do any additional setup after loading the view. 15 | } 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 968595BC28E883B300C80C64 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595BB28E883B300C80C64 /* AppDelegate.swift */; }; 11 | 968595BE28E883B300C80C64 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595BD28E883B300C80C64 /* SceneDelegate.swift */; }; 12 | 968595C028E883B300C80C64 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595BF28E883B300C80C64 /* ViewController.swift */; }; 13 | 968595C328E883B300C80C64 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 968595C128E883B300C80C64 /* Main.storyboard */; }; 14 | 968595C528E883B600C80C64 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 968595C428E883B600C80C64 /* Assets.xcassets */; }; 15 | 968595C828E883B600C80C64 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 968595C628E883B600C80C64 /* LaunchScreen.storyboard */; }; 16 | 968595D028E883EB00C80C64 /* AppDependencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595CF28E883EB00C80C64 /* AppDependencyContainer.swift */; }; 17 | 968595D328E888C100C80C64 /* Feature1ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595D228E888C100C80C64 /* Feature1ViewController.swift */; }; 18 | 968595D528E88A1300C80C64 /* Feature1DependencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595D428E88A1300C80C64 /* Feature1DependencyContainer.swift */; }; 19 | 968595D828E88ACB00C80C64 /* Feature2DependencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595D728E88ACB00C80C64 /* Feature2DependencyContainer.swift */; }; 20 | 968595DA28E88B5900C80C64 /* Feature1ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595D928E88B5900C80C64 /* Feature1ViewModel.swift */; }; 21 | 968595DD28E88BAB00C80C64 /* Feature1Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595DC28E88BAB00C80C64 /* Feature1Service.swift */; }; 22 | 968595DF28E88CB200C80C64 /* Feature1ServiceImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595DE28E88CB200C80C64 /* Feature1ServiceImplementation.swift */; }; 23 | 968595E128E8930100C80C64 /* Feature2Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595E028E8930100C80C64 /* Feature2Service.swift */; }; 24 | 968595E328E8930C00C80C64 /* Feature2ServiceImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595E228E8930C00C80C64 /* Feature2ServiceImplementation.swift */; }; 25 | 968595E528E8948700C80C64 /* Feature2ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595E428E8948700C80C64 /* Feature2ViewController.swift */; }; 26 | 968595E728E8949100C80C64 /* Feature2ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595E628E8949100C80C64 /* Feature2ViewModel.swift */; }; 27 | 968595E928E8965C00C80C64 /* Feature1Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595E828E8965C00C80C64 /* Feature1Model.swift */; }; 28 | 968595EC28E8983500C80C64 /* Feature2Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595EB28E8983500C80C64 /* Feature2Model.swift */; }; 29 | 968595F028E9AB4900C80C64 /* Feature1ServiceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595EF28E9AB4900C80C64 /* Feature1ServiceModel.swift */; }; 30 | 968595F228E9AF9100C80C64 /* Feature2ServiceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968595F128E9AF9100C80C64 /* Feature2ServiceModel.swift */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 968595B828E883B300C80C64 /* ModularisationStarter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ModularisationStarter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 968595BB28E883B300C80C64 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 36 | 968595BD28E883B300C80C64 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 37 | 968595BF28E883B300C80C64 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 38 | 968595C228E883B300C80C64 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | 968595C428E883B600C80C64 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 40 | 968595C728E883B600C80C64 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 41 | 968595C928E883B600C80C64 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 968595CF28E883EB00C80C64 /* AppDependencyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDependencyContainer.swift; sourceTree = ""; }; 43 | 968595D228E888C100C80C64 /* Feature1ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1ViewController.swift; sourceTree = ""; }; 44 | 968595D428E88A1300C80C64 /* Feature1DependencyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1DependencyContainer.swift; sourceTree = ""; }; 45 | 968595D728E88ACB00C80C64 /* Feature2DependencyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2DependencyContainer.swift; sourceTree = ""; }; 46 | 968595D928E88B5900C80C64 /* Feature1ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1ViewModel.swift; sourceTree = ""; }; 47 | 968595DC28E88BAB00C80C64 /* Feature1Service.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1Service.swift; sourceTree = ""; }; 48 | 968595DE28E88CB200C80C64 /* Feature1ServiceImplementation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1ServiceImplementation.swift; sourceTree = ""; }; 49 | 968595E028E8930100C80C64 /* Feature2Service.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2Service.swift; sourceTree = ""; }; 50 | 968595E228E8930C00C80C64 /* Feature2ServiceImplementation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2ServiceImplementation.swift; sourceTree = ""; }; 51 | 968595E428E8948700C80C64 /* Feature2ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2ViewController.swift; sourceTree = ""; }; 52 | 968595E628E8949100C80C64 /* Feature2ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2ViewModel.swift; sourceTree = ""; }; 53 | 968595E828E8965C00C80C64 /* Feature1Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1Model.swift; sourceTree = ""; }; 54 | 968595EB28E8983500C80C64 /* Feature2Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2Model.swift; sourceTree = ""; }; 55 | 968595EF28E9AB4900C80C64 /* Feature1ServiceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature1ServiceModel.swift; sourceTree = ""; }; 56 | 968595F128E9AF9100C80C64 /* Feature2ServiceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feature2ServiceModel.swift; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 968595B528E883B300C80C64 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | 968595AF28E883B300C80C64 = { 71 | isa = PBXGroup; 72 | children = ( 73 | 968595BA28E883B300C80C64 /* ModularisationStarter */, 74 | 968595B928E883B300C80C64 /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 968595B928E883B300C80C64 /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 968595B828E883B300C80C64 /* ModularisationStarter.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 968595BA28E883B300C80C64 /* ModularisationStarter */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 968595EA28E897E100C80C64 /* Models */, 90 | 968595DB28E88B9F00C80C64 /* Services */, 91 | 968595EE28E9A75D00C80C64 /* UI */, 92 | 968595BB28E883B300C80C64 /* AppDelegate.swift */, 93 | 968595BD28E883B300C80C64 /* SceneDelegate.swift */, 94 | 968595BF28E883B300C80C64 /* ViewController.swift */, 95 | 968595CF28E883EB00C80C64 /* AppDependencyContainer.swift */, 96 | 968595C128E883B300C80C64 /* Main.storyboard */, 97 | 968595C428E883B600C80C64 /* Assets.xcassets */, 98 | 968595C628E883B600C80C64 /* LaunchScreen.storyboard */, 99 | 968595C928E883B600C80C64 /* Info.plist */, 100 | ); 101 | path = ModularisationStarter; 102 | sourceTree = ""; 103 | }; 104 | 968595D128E888A900C80C64 /* Feature1 */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 968595D428E88A1300C80C64 /* Feature1DependencyContainer.swift */, 108 | 968595D228E888C100C80C64 /* Feature1ViewController.swift */, 109 | 968595D928E88B5900C80C64 /* Feature1ViewModel.swift */, 110 | ); 111 | path = Feature1; 112 | sourceTree = ""; 113 | }; 114 | 968595D628E88AB900C80C64 /* Feature2 */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 968595D728E88ACB00C80C64 /* Feature2DependencyContainer.swift */, 118 | 968595E428E8948700C80C64 /* Feature2ViewController.swift */, 119 | 968595E628E8949100C80C64 /* Feature2ViewModel.swift */, 120 | ); 121 | path = Feature2; 122 | sourceTree = ""; 123 | }; 124 | 968595DB28E88B9F00C80C64 /* Services */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 968595DC28E88BAB00C80C64 /* Feature1Service.swift */, 128 | 968595DE28E88CB200C80C64 /* Feature1ServiceImplementation.swift */, 129 | 968595EF28E9AB4900C80C64 /* Feature1ServiceModel.swift */, 130 | 968595E028E8930100C80C64 /* Feature2Service.swift */, 131 | 968595E228E8930C00C80C64 /* Feature2ServiceImplementation.swift */, 132 | 968595F128E9AF9100C80C64 /* Feature2ServiceModel.swift */, 133 | ); 134 | path = Services; 135 | sourceTree = ""; 136 | }; 137 | 968595EA28E897E100C80C64 /* Models */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 968595E828E8965C00C80C64 /* Feature1Model.swift */, 141 | 968595EB28E8983500C80C64 /* Feature2Model.swift */, 142 | ); 143 | path = Models; 144 | sourceTree = ""; 145 | }; 146 | 968595EE28E9A75D00C80C64 /* UI */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 968595D128E888A900C80C64 /* Feature1 */, 150 | 968595D628E88AB900C80C64 /* Feature2 */, 151 | ); 152 | path = UI; 153 | sourceTree = ""; 154 | }; 155 | /* End PBXGroup section */ 156 | 157 | /* Begin PBXNativeTarget section */ 158 | 968595B728E883B300C80C64 /* ModularisationStarter */ = { 159 | isa = PBXNativeTarget; 160 | buildConfigurationList = 968595CC28E883B600C80C64 /* Build configuration list for PBXNativeTarget "ModularisationStarter" */; 161 | buildPhases = ( 162 | 968595B428E883B300C80C64 /* Sources */, 163 | 968595B528E883B300C80C64 /* Frameworks */, 164 | 968595B628E883B300C80C64 /* Resources */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | ); 170 | name = ModularisationStarter; 171 | productName = ModularisationStarter; 172 | productReference = 968595B828E883B300C80C64 /* ModularisationStarter.app */; 173 | productType = "com.apple.product-type.application"; 174 | }; 175 | /* End PBXNativeTarget section */ 176 | 177 | /* Begin PBXProject section */ 178 | 968595B028E883B300C80C64 /* Project object */ = { 179 | isa = PBXProject; 180 | attributes = { 181 | BuildIndependentTargetsInParallel = 1; 182 | LastSwiftUpdateCheck = 1340; 183 | LastUpgradeCheck = 1340; 184 | TargetAttributes = { 185 | 968595B728E883B300C80C64 = { 186 | CreatedOnToolsVersion = 13.4.1; 187 | }; 188 | }; 189 | }; 190 | buildConfigurationList = 968595B328E883B300C80C64 /* Build configuration list for PBXProject "ModularisationStarter" */; 191 | compatibilityVersion = "Xcode 13.0"; 192 | developmentRegion = en; 193 | hasScannedForEncodings = 0; 194 | knownRegions = ( 195 | en, 196 | Base, 197 | ); 198 | mainGroup = 968595AF28E883B300C80C64; 199 | productRefGroup = 968595B928E883B300C80C64 /* Products */; 200 | projectDirPath = ""; 201 | projectRoot = ""; 202 | targets = ( 203 | 968595B728E883B300C80C64 /* ModularisationStarter */, 204 | ); 205 | }; 206 | /* End PBXProject section */ 207 | 208 | /* Begin PBXResourcesBuildPhase section */ 209 | 968595B628E883B300C80C64 /* Resources */ = { 210 | isa = PBXResourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 968595C828E883B600C80C64 /* LaunchScreen.storyboard in Resources */, 214 | 968595C528E883B600C80C64 /* Assets.xcassets in Resources */, 215 | 968595C328E883B300C80C64 /* Main.storyboard in Resources */, 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | }; 219 | /* End PBXResourcesBuildPhase section */ 220 | 221 | /* Begin PBXSourcesBuildPhase section */ 222 | 968595B428E883B300C80C64 /* Sources */ = { 223 | isa = PBXSourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | 968595D828E88ACB00C80C64 /* Feature2DependencyContainer.swift in Sources */, 227 | 968595D328E888C100C80C64 /* Feature1ViewController.swift in Sources */, 228 | 968595DF28E88CB200C80C64 /* Feature1ServiceImplementation.swift in Sources */, 229 | 968595E328E8930C00C80C64 /* Feature2ServiceImplementation.swift in Sources */, 230 | 968595E728E8949100C80C64 /* Feature2ViewModel.swift in Sources */, 231 | 968595C028E883B300C80C64 /* ViewController.swift in Sources */, 232 | 968595DA28E88B5900C80C64 /* Feature1ViewModel.swift in Sources */, 233 | 968595E128E8930100C80C64 /* Feature2Service.swift in Sources */, 234 | 968595BC28E883B300C80C64 /* AppDelegate.swift in Sources */, 235 | 968595DD28E88BAB00C80C64 /* Feature1Service.swift in Sources */, 236 | 968595E928E8965C00C80C64 /* Feature1Model.swift in Sources */, 237 | 968595F228E9AF9100C80C64 /* Feature2ServiceModel.swift in Sources */, 238 | 968595E528E8948700C80C64 /* Feature2ViewController.swift in Sources */, 239 | 968595D528E88A1300C80C64 /* Feature1DependencyContainer.swift in Sources */, 240 | 968595F028E9AB4900C80C64 /* Feature1ServiceModel.swift in Sources */, 241 | 968595EC28E8983500C80C64 /* Feature2Model.swift in Sources */, 242 | 968595D028E883EB00C80C64 /* AppDependencyContainer.swift in Sources */, 243 | 968595BE28E883B300C80C64 /* SceneDelegate.swift in Sources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | /* End PBXSourcesBuildPhase section */ 248 | 249 | /* Begin PBXVariantGroup section */ 250 | 968595C128E883B300C80C64 /* Main.storyboard */ = { 251 | isa = PBXVariantGroup; 252 | children = ( 253 | 968595C228E883B300C80C64 /* Base */, 254 | ); 255 | name = Main.storyboard; 256 | sourceTree = ""; 257 | }; 258 | 968595C628E883B600C80C64 /* LaunchScreen.storyboard */ = { 259 | isa = PBXVariantGroup; 260 | children = ( 261 | 968595C728E883B600C80C64 /* Base */, 262 | ); 263 | name = LaunchScreen.storyboard; 264 | sourceTree = ""; 265 | }; 266 | /* End PBXVariantGroup section */ 267 | 268 | /* Begin XCBuildConfiguration section */ 269 | 968595CA28E883B600C80C64 /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ALWAYS_SEARCH_USER_PATHS = NO; 273 | CLANG_ANALYZER_NONNULL = YES; 274 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 275 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 276 | CLANG_ENABLE_MODULES = YES; 277 | CLANG_ENABLE_OBJC_ARC = YES; 278 | CLANG_ENABLE_OBJC_WEAK = YES; 279 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 280 | CLANG_WARN_BOOL_CONVERSION = YES; 281 | CLANG_WARN_COMMA = YES; 282 | CLANG_WARN_CONSTANT_CONVERSION = YES; 283 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 284 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 285 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 286 | CLANG_WARN_EMPTY_BODY = YES; 287 | CLANG_WARN_ENUM_CONVERSION = YES; 288 | CLANG_WARN_INFINITE_RECURSION = YES; 289 | CLANG_WARN_INT_CONVERSION = YES; 290 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 291 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 292 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 293 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 294 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 295 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 296 | CLANG_WARN_STRICT_PROTOTYPES = YES; 297 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 298 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 299 | CLANG_WARN_UNREACHABLE_CODE = YES; 300 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 301 | COPY_PHASE_STRIP = NO; 302 | DEBUG_INFORMATION_FORMAT = dwarf; 303 | ENABLE_STRICT_OBJC_MSGSEND = YES; 304 | ENABLE_TESTABILITY = YES; 305 | GCC_C_LANGUAGE_STANDARD = gnu11; 306 | GCC_DYNAMIC_NO_PIC = NO; 307 | GCC_NO_COMMON_BLOCKS = YES; 308 | GCC_OPTIMIZATION_LEVEL = 0; 309 | GCC_PREPROCESSOR_DEFINITIONS = ( 310 | "DEBUG=1", 311 | "$(inherited)", 312 | ); 313 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 314 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 315 | GCC_WARN_UNDECLARED_SELECTOR = YES; 316 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 317 | GCC_WARN_UNUSED_FUNCTION = YES; 318 | GCC_WARN_UNUSED_VARIABLE = YES; 319 | IPHONEOS_DEPLOYMENT_TARGET = 15.5; 320 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 321 | MTL_FAST_MATH = YES; 322 | ONLY_ACTIVE_ARCH = YES; 323 | SDKROOT = iphoneos; 324 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 325 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 326 | }; 327 | name = Debug; 328 | }; 329 | 968595CB28E883B600C80C64 /* Release */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | CLANG_ANALYZER_NONNULL = YES; 334 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_ENABLE_OBJC_WEAK = YES; 339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_COMMA = YES; 342 | CLANG_WARN_CONSTANT_CONVERSION = YES; 343 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INFINITE_RECURSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 363 | ENABLE_NS_ASSERTIONS = NO; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu11; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 15.5; 374 | MTL_ENABLE_DEBUG_INFO = NO; 375 | MTL_FAST_MATH = YES; 376 | SDKROOT = iphoneos; 377 | SWIFT_COMPILATION_MODE = wholemodule; 378 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 379 | VALIDATE_PRODUCT = YES; 380 | }; 381 | name = Release; 382 | }; 383 | 968595CD28E883B600C80C64 /* Debug */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 387 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 388 | CODE_SIGN_STYLE = Automatic; 389 | CURRENT_PROJECT_VERSION = 1; 390 | DEVELOPMENT_TEAM = ""; 391 | GENERATE_INFOPLIST_FILE = YES; 392 | INFOPLIST_FILE = ModularisationStarter/Info.plist; 393 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 394 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 395 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 396 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 397 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 398 | LD_RUNPATH_SEARCH_PATHS = ( 399 | "$(inherited)", 400 | "@executable_path/Frameworks", 401 | ); 402 | MARKETING_VERSION = 1.0; 403 | PRODUCT_BUNDLE_IDENTIFIER = sashensingh.ModularisationStarter; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | SWIFT_EMIT_LOC_STRINGS = YES; 406 | SWIFT_VERSION = 5.0; 407 | TARGETED_DEVICE_FAMILY = "1,2"; 408 | }; 409 | name = Debug; 410 | }; 411 | 968595CE28E883B600C80C64 /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 415 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 416 | CODE_SIGN_STYLE = Automatic; 417 | CURRENT_PROJECT_VERSION = 1; 418 | DEVELOPMENT_TEAM = ""; 419 | GENERATE_INFOPLIST_FILE = YES; 420 | INFOPLIST_FILE = ModularisationStarter/Info.plist; 421 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 422 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 423 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 424 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 425 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 426 | LD_RUNPATH_SEARCH_PATHS = ( 427 | "$(inherited)", 428 | "@executable_path/Frameworks", 429 | ); 430 | MARKETING_VERSION = 1.0; 431 | PRODUCT_BUNDLE_IDENTIFIER = sashensingh.ModularisationStarter; 432 | PRODUCT_NAME = "$(TARGET_NAME)"; 433 | SWIFT_EMIT_LOC_STRINGS = YES; 434 | SWIFT_VERSION = 5.0; 435 | TARGETED_DEVICE_FAMILY = "1,2"; 436 | }; 437 | name = Release; 438 | }; 439 | /* End XCBuildConfiguration section */ 440 | 441 | /* Begin XCConfigurationList section */ 442 | 968595B328E883B300C80C64 /* Build configuration list for PBXProject "ModularisationStarter" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | 968595CA28E883B600C80C64 /* Debug */, 446 | 968595CB28E883B600C80C64 /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | 968595CC28E883B600C80C64 /* Build configuration list for PBXNativeTarget "ModularisationStarter" */ = { 452 | isa = XCConfigurationList; 453 | buildConfigurations = ( 454 | 968595CD28E883B600C80C64 /* Debug */, 455 | 968595CE28E883B600C80C64 /* Release */, 456 | ); 457 | defaultConfigurationIsVisible = 0; 458 | defaultConfigurationName = Release; 459 | }; 460 | /* End XCConfigurationList section */ 461 | }; 462 | rootObject = 968595B028E883B300C80C64 /* Project object */; 463 | } 464 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter.xcodeproj/project.xcworkspace/xcuserdata/sashensingh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SashenSinghDev/ModularisationExample/3cbfe3c547601f5c4b1151f02b6262ebfae8b38f/ModularisationStarter/ModularisationStarter.xcodeproj/project.xcworkspace/xcuserdata/sashensingh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter.xcodeproj/xcuserdata/sashensingh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter.xcodeproj/xcuserdata/sashensingh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ModularisationStarter.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/AppDependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ApPDependencyContainer.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | final class AppDependencyContainer { 12 | 13 | let feature1ViewController: UIViewController 14 | let feature2ViewController: UIViewController 15 | 16 | init() { 17 | 18 | func makeFeature1ViewController() -> UIViewController { 19 | let feature1DependencyContainer = Feature1DependencyContainer() 20 | return feature1DependencyContainer.makeFeature1ViewController() 21 | } 22 | 23 | func makeFeature2ViewController() -> UIViewController { 24 | let feature2DependencyContainer = Feature2DependencyContainer() 25 | return feature2DependencyContainer.makeFeature2ViewController() 26 | } 27 | 28 | feature1ViewController = makeFeature1ViewController() 29 | feature2ViewController = makeFeature2ViewController() 30 | } 31 | 32 | func makeMainViewController() -> UITabBarController { 33 | let tabViewController = UITabBarController() 34 | 35 | feature1ViewController.tabBarItem = UITabBarItem(title: "feature1", 36 | image: nil, selectedImage: nil) 37 | 38 | feature2ViewController.tabBarItem = UITabBarItem(title: "feature2", 39 | image: nil, selectedImage: nil) 40 | 41 | tabViewController.tabBar.isTranslucent = false 42 | tabViewController.tabBar.backgroundColor = .white 43 | 44 | tabViewController.viewControllers = [feature1ViewController, 45 | feature2ViewController] 46 | return tabViewController 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "2x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "83.5x83.5" 82 | }, 83 | { 84 | "idiom" : "ios-marketing", 85 | "scale" : "1x", 86 | "size" : "1024x1024" 87 | } 88 | ], 89 | "info" : { 90 | "author" : "xcode", 91 | "version" : 1 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/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 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/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 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Models/Feature1Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1Model.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature1Model { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Models/Feature2Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2Model.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature2Model { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import UIKit 9 | 10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | 21 | let appDependancyContainer = AppDependencyContainer() 22 | 23 | window?.backgroundColor = .clear 24 | window?.rootViewController = appDependancyContainer.makeMainViewController() 25 | } 26 | 27 | func sceneDidDisconnect(_ scene: UIScene) { 28 | // Called as the scene is being released by the system. 29 | // This occurs shortly after the scene enters the background, or when its session is discarded. 30 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 31 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 32 | } 33 | 34 | func sceneDidBecomeActive(_ scene: UIScene) { 35 | // Called when the scene has moved from an inactive state to an active state. 36 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 37 | } 38 | 39 | func sceneWillResignActive(_ scene: UIScene) { 40 | // Called when the scene will move from an active state to an inactive state. 41 | // This may occur due to temporary interruptions (ex. an incoming phone call). 42 | } 43 | 44 | func sceneWillEnterForeground(_ scene: UIScene) { 45 | // Called as the scene transitions from the background to the foreground. 46 | // Use this method to undo the changes made on entering the background. 47 | } 48 | 49 | func sceneDidEnterBackground(_ scene: UIScene) { 50 | // Called as the scene transitions from the foreground to the background. 51 | // Use this method to save data, release shared resources, and store enough scene-specific state information 52 | // to restore the scene back to its current state. 53 | } 54 | 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Services/Feature1Service.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1Service.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | protocol Feature1Service { 11 | func fetchData(completion: @escaping (Feature1Model) -> ()) 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Services/Feature1ServiceImplementation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ServiceImplementation.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | final class Feature1ServiceImplementation: Feature1Service { 11 | func fetchData(completion: @escaping (Feature1Model) -> ()) { 12 | let serviceModel = Feature1ServiceModel(data: "Feature1Data") 13 | let mappedFeatureModel = Feature1Model(feature1ServiceModel: serviceModel) 14 | completion(mappedFeatureModel) 15 | } 16 | } 17 | 18 | private extension Feature1Model { 19 | init(feature1ServiceModel: Feature1ServiceModel) { 20 | self.data = feature1ServiceModel.data 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Services/Feature1ServiceModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ServiceModel.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/02. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature1ServiceModel { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Services/Feature2Service.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2Service.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | protocol Feature2Service { 11 | func fetchData(completion: @escaping (Feature2Model) -> ()) 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Services/Feature2ServiceImplementation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ServiceImplementation.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | final class Feature2ServiceImplementation: Feature2Service { 11 | func fetchData(completion: @escaping (Feature2Model) -> ()) { 12 | let serviceModel = Feature2ServiceModel(data: "Feature2Data") 13 | let mappedFeatureModel = Feature2Model(feature2ServiceModel: serviceModel) 14 | 15 | completion(mappedFeatureModel) 16 | } 17 | } 18 | 19 | private extension Feature2Model { 20 | init(feature2ServiceModel: Feature2ServiceModel) { 21 | self.data = feature2ServiceModel.data 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/Services/Feature2ServiceModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ServiceModel.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/02. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature2ServiceModel { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/UI/Feature1/Feature1DependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1DependencyContainer.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | final class Feature1DependencyContainer { 12 | 13 | private let feature1ViewModel: Feature1ViewModel 14 | 15 | init() { 16 | func makeFeature1ViewModel() -> Feature1ViewModel { 17 | let feature1Service = Feature1ServiceImplementation() 18 | return Feature1ViewModel(service: feature1Service) 19 | } 20 | 21 | feature1ViewModel = makeFeature1ViewModel() 22 | } 23 | 24 | func makeFeature1ViewController() -> UIViewController { 25 | let feature1ViewController = Feature1ViewController(viewModel: feature1ViewModel) 26 | return feature1ViewController 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/UI/Feature1/Feature1ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ViewController.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | public final class Feature1ViewController: UIViewController { 12 | 13 | private var viewModel: Feature1ViewModel 14 | private let dataLabel: UILabel = { 15 | let label = UILabel() 16 | return label 17 | }() 18 | 19 | init(viewModel: Feature1ViewModel) { 20 | self.viewModel = viewModel 21 | 22 | super.init(nibName: nil, bundle: nil) 23 | } 24 | 25 | required init?(coder: NSCoder) { 26 | fatalError("init(coder:) has not been implemented") 27 | } 28 | 29 | public override func viewDidLoad() { 30 | view.backgroundColor = .red 31 | 32 | addLabel() 33 | bindToViewModel() 34 | viewModel.loadData() 35 | } 36 | 37 | private func bindToViewModel() { 38 | viewModel.stateChanged = { [weak self] state in 39 | guard let self = self else { return } 40 | 41 | switch state { 42 | case .initial: 43 | break 44 | case .loadedData(let model): 45 | self.dataLabel.text = model.data 46 | } 47 | } 48 | } 49 | 50 | private func addLabel() { 51 | view.addSubview(dataLabel) 52 | dataLabel.translatesAutoresizingMaskIntoConstraints = false 53 | dataLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true 54 | dataLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/UI/Feature1/Feature1ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ViewModel.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | enum ViewStateFeature1 { 11 | case initial 12 | case loadedData(Feature1Model) 13 | } 14 | 15 | final class Feature1ViewModel { 16 | private let service: Feature1Service 17 | 18 | var stateChanged: (ViewStateFeature1) -> Void = { _ in } 19 | 20 | init(service: Feature1Service) { 21 | self.service = service 22 | } 23 | 24 | func loadData() { 25 | service.fetchData { [weak self] modelData in 26 | guard let self = self else { return } 27 | 28 | self.stateChanged(.loadedData(modelData)) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/UI/Feature2/Feature2DependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2DependencyContainer.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | final class Feature2DependencyContainer { 12 | 13 | private let feature2ViewModel: Feature2ViewModel 14 | 15 | init() { 16 | func makeFeature2ViewModel() -> Feature2ViewModel { 17 | let feature2Service = Feature2ServiceImplementation() 18 | return Feature2ViewModel(service: feature2Service) 19 | } 20 | 21 | feature2ViewModel = makeFeature2ViewModel() 22 | } 23 | 24 | func makeFeature2ViewController() -> UIViewController { 25 | let feature2ViewController = Feature2ViewController(viewModel: feature2ViewModel) 26 | return feature2ViewController 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/UI/Feature2/Feature2ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ViewController.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | public final class Feature2ViewController: UIViewController { 12 | 13 | private var viewModel: Feature2ViewModel 14 | private let dataLabel: UILabel = { 15 | let label = UILabel() 16 | return label 17 | }() 18 | 19 | init(viewModel: Feature2ViewModel) { 20 | self.viewModel = viewModel 21 | 22 | super.init(nibName: nil, bundle: nil) 23 | } 24 | 25 | required init?(coder: NSCoder) { 26 | fatalError("init(coder:) has not been implemented") 27 | } 28 | 29 | public override func viewDidLoad() { 30 | view.backgroundColor = .blue 31 | 32 | addLabel() 33 | bindToViewModel() 34 | viewModel.loadData() 35 | } 36 | 37 | private func bindToViewModel() { 38 | viewModel.stateChanged = { [weak self] state in 39 | guard let self = self else { return } 40 | 41 | switch state { 42 | case .initial: 43 | break 44 | case .loadedData(let model): 45 | self.dataLabel.text = model.data 46 | } 47 | } 48 | } 49 | 50 | private func addLabel() { 51 | view.addSubview(dataLabel) 52 | dataLabel.translatesAutoresizingMaskIntoConstraints = false 53 | dataLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true 54 | dataLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/UI/Feature2/Feature2ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ViewModel.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | enum ViewStateFeature2 { 11 | case initial 12 | case loadedData(Feature2Model) 13 | } 14 | 15 | final class Feature2ViewModel { 16 | private let service: Feature2Service 17 | 18 | var stateChanged: (ViewStateFeature2) -> Void = { _ in } 19 | 20 | init(service: Feature2Service) { 21 | self.service = service 22 | } 23 | 24 | func loadData() { 25 | service.fetchData { [weak self] modelData in 26 | guard let self = self else { return } 27 | 28 | self.stateChanged(.loadedData(modelData)) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ModularisationStarter/ModularisationStarter/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import UIKit 9 | 10 | class ViewController: UIViewController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | // Do any additional setup after loading the view. 15 | } 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Feature1ExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "2x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "83.5x83.5" 82 | }, 83 | { 84 | "idiom" : "ios-marketing", 85 | "scale" : "1x", 86 | "size" : "1024x1024" 87 | } 88 | ], 89 | "info" : { 90 | "author" : "xcode", 91 | "version" : 1 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/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 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/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 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // Feature1ExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import UIKit 9 | import FeatureModule1UI 10 | import FeatureImplementations 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | guard let _ = (scene as? UIWindowScene) else { return } 22 | 23 | let dependancyContainer = Feature1DependencyContainer(service: Feature1ServiceImplementation()) 24 | 25 | window?.backgroundColor = .clear 26 | window?.rootViewController = dependancyContainer.makeFeature1ViewController() 27 | } 28 | 29 | func sceneDidDisconnect(_ scene: UIScene) { 30 | // Called as the scene is being released by the system. 31 | // This occurs shortly after the scene enters the background, or when its session is discarded. 32 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 33 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 34 | } 35 | 36 | func sceneDidBecomeActive(_ scene: UIScene) { 37 | // Called when the scene has moved from an inactive state to an active state. 38 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 39 | } 40 | 41 | func sceneWillResignActive(_ scene: UIScene) { 42 | // Called when the scene will move from an active state to an inactive state. 43 | // This may occur due to temporary interruptions (ex. an incoming phone call). 44 | } 45 | 46 | func sceneWillEnterForeground(_ scene: UIScene) { 47 | // Called as the scene transitions from the background to the foreground. 48 | // Use this method to undo the changes made on entering the background. 49 | } 50 | 51 | func sceneDidEnterBackground(_ scene: UIScene) { 52 | // Called as the scene transitions from the foreground to the background. 53 | // Use this method to save data, release shared resources, and store enough scene-specific state information 54 | // to restore the scene back to its current state. 55 | } 56 | 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature1ExampleApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Feature1ExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import UIKit 9 | 10 | class ViewController: UIViewController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | // Do any additional setup after loading the view. 15 | } 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Feature2ExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "2x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "83.5x83.5" 82 | }, 83 | { 84 | "idiom" : "ios-marketing", 85 | "scale" : "1x", 86 | "size" : "1024x1024" 87 | } 88 | ], 89 | "info" : { 90 | "author" : "xcode", 91 | "version" : 1 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/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 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/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 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // Feature2ExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | import Feature2Module 10 | 11 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 12 | 13 | var window: UIWindow? 14 | 15 | 16 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 17 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 18 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 19 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 20 | guard let _ = (scene as? UIWindowScene) else { return } 21 | 22 | let dependancyContainer = Feature2DependencyContainer() 23 | 24 | window?.backgroundColor = .clear 25 | window?.rootViewController = dependancyContainer.makeFeature2ViewController() 26 | } 27 | 28 | func sceneDidDisconnect(_ scene: UIScene) { 29 | // Called as the scene is being released by the system. 30 | // This occurs shortly after the scene enters the background, or when its session is discarded. 31 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 32 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 33 | } 34 | 35 | func sceneDidBecomeActive(_ scene: UIScene) { 36 | // Called when the scene has moved from an inactive state to an active state. 37 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 38 | } 39 | 40 | func sceneWillResignActive(_ scene: UIScene) { 41 | // Called when the scene will move from an active state to an inactive state. 42 | // This may occur due to temporary interruptions (ex. an incoming phone call). 43 | } 44 | 45 | func sceneWillEnterForeground(_ scene: UIScene) { 46 | // Called as the scene transitions from the background to the foreground. 47 | // Use this method to undo the changes made on entering the background. 48 | } 49 | 50 | func sceneDidEnterBackground(_ scene: UIScene) { 51 | // Called as the scene transitions from the foreground to the background. 52 | // Use this method to save data, release shared resources, and store enough scene-specific state information 53 | // to restore the scene back to its current state. 54 | } 55 | 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /ModularisationVertical/Feature2ExampleApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Feature2ExampleApp 4 | // 5 | // Created by Sashen Singh on 2022/10/09. 6 | // 7 | 8 | import UIKit 9 | 10 | class ViewController: UIViewController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | // Do any additional setup after loading the view. 15 | } 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical.xcodeproj/project.xcworkspace/xcuserdata/sashensingh.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SashenSinghDev/ModularisationExample/3cbfe3c547601f5c4b1151f02b6262ebfae8b38f/ModularisationVertical/ModularisationVertical.xcodeproj/project.xcworkspace/xcuserdata/sashensingh.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical.xcodeproj/xcshareddata/xcschemes/ModularisationVertical.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical.xcodeproj/xcuserdata/sashensingh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Feature1ExampleApp.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 3 11 | 12 | Feature2ExampleApp.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 2 16 | 17 | ModularisationVertical.xcscheme_^#shared#^_ 18 | 19 | orderHint 20 | 1 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 96EC980228E9FF9D001417AB 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/02. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/AppDependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ApPDependencyContainer.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import FeatureModule1UI 11 | import FeatureImplementations 12 | import Feature2Module 13 | 14 | final class AppDependencyContainer { 15 | 16 | let feature1ViewController: UIViewController 17 | let feature2ViewController: UIViewController 18 | 19 | init() { 20 | 21 | func makeFeature1ViewController() -> UIViewController { 22 | let feature1Service = Feature1ServiceImplementation() 23 | let feature1DependencyContainer = Feature1DependencyContainer(service: feature1Service) 24 | return feature1DependencyContainer.makeFeature1ViewController() 25 | } 26 | 27 | func makeFeature2ViewController() -> UIViewController { 28 | let feature2DependencyContainer = Feature2DependencyContainer() 29 | return feature2DependencyContainer.makeFeature2ViewController() 30 | } 31 | 32 | feature1ViewController = makeFeature1ViewController() 33 | feature2ViewController = makeFeature2ViewController() 34 | } 35 | 36 | func makeMainViewController() -> UITabBarController { 37 | let tabViewController = UITabBarController() 38 | 39 | feature1ViewController.tabBarItem = UITabBarItem(title: "feature1", 40 | image: nil, selectedImage: nil) 41 | 42 | feature2ViewController.tabBarItem = UITabBarItem(title: "feature2", 43 | image: nil, selectedImage: nil) 44 | 45 | tabViewController.tabBar.isTranslucent = false 46 | tabViewController.tabBar.backgroundColor = .white 47 | 48 | tabViewController.viewControllers = [feature1ViewController, 49 | feature2ViewController] 50 | return tabViewController 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "2x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "83.5x83.5" 82 | }, 83 | { 84 | "idiom" : "ios-marketing", 85 | "scale" : "1x", 86 | "size" : "1024x1024" 87 | } 88 | ], 89 | "info" : { 90 | "author" : "xcode", 91 | "version" : 1 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/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 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/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 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/.swiftpm/xcode/xcshareddata/xcschemes/Feature1Module.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Feature1Module", 8 | platforms: [.iOS(.v15)], 9 | products: [ 10 | // Products define the executables and libraries a package produces, and make them visible to other packages. 11 | .library( 12 | name: "Feature1Module", 13 | targets: ["FeatureModule1UI", "FeatureImplementations"]), 14 | ], 15 | dependencies: [ 16 | // Dependencies declare other packages that this package depends on. 17 | // .package(url: /* package url */, from: "1.0.0"), 18 | ], 19 | targets: [ 20 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 21 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 22 | .target( 23 | name: "FeatureModule1UI", 24 | dependencies: ["Presentation"]), 25 | .target( 26 | name: "Presentation", 27 | dependencies: ["Feature"]), 28 | .target( 29 | name: "Feature", 30 | dependencies: []), 31 | .target( 32 | name: "FeatureImplementations", 33 | dependencies: ["Feature"]), 34 | .testTarget( 35 | name: "Feature1ModuleTests", 36 | dependencies: ["FeatureModule1UI"]), 37 | ] 38 | ) 39 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/README.md: -------------------------------------------------------------------------------- 1 | # Feature1Module 2 | 3 | A description of this package. 4 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Sources/Feature/Feature1Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1Model.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | 10 | public struct Feature1Model { 11 | public let data: String 12 | 13 | public init(data: String) { 14 | self.data = data 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Sources/Feature/Feature1Service.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1Service.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | 10 | public protocol Feature1Service { 11 | func fetchData(completion: @escaping (Feature1Model) -> ()) 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Sources/FeatureImplementations/Feature1ServiceImplementation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ServiceImplementation.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | import Feature 10 | 11 | public final class Feature1ServiceImplementation: Feature1Service { 12 | public init() {} 13 | 14 | public func fetchData(completion: @escaping (Feature1Model) -> ()) { 15 | let serviceModel = Feature1ServiceModel(data: "Feature1Data") 16 | let mappedFeatureModel = Feature1Model(feature1ServiceModel: serviceModel) 17 | completion(mappedFeatureModel) 18 | } 19 | } 20 | 21 | private extension Feature1Model { 22 | init(feature1ServiceModel: Feature1ServiceModel) { 23 | self.init(data: feature1ServiceModel.data) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Sources/FeatureImplementations/Feature1ServiceModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ServiceModel.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature1ServiceModel { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Sources/FeatureModule1UI/Feature1DependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1DependencyContainer.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import Feature 11 | import Presentation 12 | 13 | public final class Feature1DependencyContainer { 14 | 15 | private let feature1ViewModel: Feature1ViewModel 16 | 17 | public init(service: Feature1Service) { 18 | func makeFeature1ViewModel() -> Feature1ViewModel { 19 | return Feature1ViewModel(service: service) 20 | } 21 | 22 | feature1ViewModel = makeFeature1ViewModel() 23 | } 24 | 25 | public func makeFeature1ViewController() -> UIViewController { 26 | let feature1ViewController = Feature1ViewController(viewModel: feature1ViewModel) 27 | return feature1ViewController 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Sources/FeatureModule1UI/Feature1ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ViewController.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import Presentation 11 | 12 | public final class Feature1ViewController: UIViewController { 13 | 14 | private var viewModel: Feature1ViewModel 15 | private let dataLabel: UILabel = { 16 | let label = UILabel() 17 | return label 18 | }() 19 | 20 | init(viewModel: Feature1ViewModel) { 21 | self.viewModel = viewModel 22 | 23 | super.init(nibName: nil, bundle: nil) 24 | } 25 | 26 | required init?(coder: NSCoder) { 27 | fatalError("init(coder:) has not been implemented") 28 | } 29 | 30 | public override func viewDidLoad() { 31 | view.backgroundColor = .red 32 | 33 | addLabel() 34 | bindToViewModel() 35 | viewModel.loadData() 36 | } 37 | 38 | private func bindToViewModel() { 39 | viewModel.stateChanged = { [weak self] state in 40 | guard let self = self else { return } 41 | 42 | switch state { 43 | case .initial: 44 | break 45 | case .loadedData(let data): 46 | self.dataLabel.text = data 47 | } 48 | } 49 | } 50 | 51 | private func addLabel() { 52 | view.addSubview(dataLabel) 53 | dataLabel.translatesAutoresizingMaskIntoConstraints = false 54 | dataLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true 55 | dataLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Sources/Presentation/Feature1ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature1ViewModel.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import Feature 10 | 11 | public final class Feature1ViewModel { 12 | private let service: Feature1Service 13 | 14 | public enum ViewStateFeature1 { 15 | case initial 16 | case loadedData(String) 17 | } 18 | 19 | public var stateChanged: (ViewStateFeature1) -> Void = { _ in } 20 | 21 | public init(service: Feature1Service) { 22 | self.service = service 23 | } 24 | 25 | public func loadData() { 26 | service.fetchData { [weak self] modelData in 27 | guard let self = self else { return } 28 | 29 | self.stateChanged(.loadedData(modelData.data)) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature1Module/Tests/Feature1ModuleTests/Feature1ModuleTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import Feature1Module 3 | 4 | final class Feature1ModuleTests: XCTestCase { 5 | func testExample() throws { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(Feature1Module().text, "Hello, World!") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Feature2Module", 8 | platforms: [.iOS(.v15)], 9 | products: [ 10 | // Products define the executables and libraries a package produces, and make them visible to other packages. 11 | .library( 12 | name: "Feature2Module", 13 | targets: ["Feature2Module"]), 14 | ], 15 | dependencies: [ 16 | // Dependencies declare other packages that this package depends on. 17 | // .package(url: /* package url */, from: "1.0.0"), 18 | ], 19 | targets: [ 20 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 21 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 22 | .target( 23 | name: "Feature2Module", 24 | dependencies: []), 25 | .testTarget( 26 | name: "Feature2ModuleTests", 27 | dependencies: ["Feature2Module"]), 28 | ] 29 | ) 30 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/README.md: -------------------------------------------------------------------------------- 1 | # Feature2Module 2 | 3 | A description of this package. 4 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/Feature Implementations/Feature2ServiceImplementation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ServiceImplementation.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | 10 | final class Feature2ServiceImplementation: Feature2Service { 11 | func fetchData(completion: @escaping (Feature2Model) -> ()) { 12 | let serviceModel = Feature2ServiceModel(data: "Feature2Data") 13 | let mappedFeatureModel = Feature2Model(feature2ServiceModel: serviceModel) 14 | 15 | completion(mappedFeatureModel) 16 | } 17 | } 18 | 19 | private extension Feature2Model { 20 | init(feature2ServiceModel: Feature2ServiceModel) { 21 | self.data = feature2ServiceModel.data 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/Feature Implementations/Feature2ServiceModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ServiceModel.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature2ServiceModel { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/Feature/Feature2Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2Model.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | 10 | struct Feature2Model { 11 | let data: String 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/Feature/Feature2Service.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2Service.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/04. 6 | // 7 | 8 | import Foundation 9 | 10 | protocol Feature2Service { 11 | func fetchData(completion: @escaping (Feature2Model) -> ()) 12 | } 13 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/Feature2Module.swift: -------------------------------------------------------------------------------- 1 | public struct Feature2Module { 2 | public private(set) var text = "Hello, World!" 3 | 4 | public init() { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/Presentation/Feature2ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ViewModel.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | 10 | enum ViewStateFeature2 { 11 | case initial 12 | case loadedData(Feature2Model) 13 | } 14 | 15 | final class Feature2ViewModel { 16 | private let service: Feature2Service 17 | 18 | var stateChanged: (ViewStateFeature2) -> Void = { _ in } 19 | 20 | init(service: Feature2Service) { 21 | self.service = service 22 | } 23 | 24 | func loadData() { 25 | service.fetchData { [weak self] modelData in 26 | guard let self = self else { return } 27 | 28 | self.stateChanged(.loadedData(modelData)) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/UI/Feature2DependencyContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2DependencyContainer.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | public final class Feature2DependencyContainer { 12 | 13 | private let feature2ViewModel: Feature2ViewModel 14 | 15 | public init() { 16 | func makeFeature2ViewModel() -> Feature2ViewModel { 17 | let feature2Service = Feature2ServiceImplementation() 18 | return Feature2ViewModel(service: feature2Service) 19 | } 20 | 21 | feature2ViewModel = makeFeature2ViewModel() 22 | } 23 | 24 | public func makeFeature2ViewController() -> UIViewController { 25 | let feature2ViewController = Feature2ViewController(viewModel: feature2ViewModel) 26 | return feature2ViewController 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Sources/Feature2Module/UI/Feature2ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Feature2ViewController.swift 3 | // ModularisationStarter 4 | // 5 | // Created by Sashen Singh on 2022/10/01. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | public final class Feature2ViewController: UIViewController { 12 | 13 | private var viewModel: Feature2ViewModel 14 | private let dataLabel: UILabel = { 15 | let label = UILabel() 16 | return label 17 | }() 18 | 19 | init(viewModel: Feature2ViewModel) { 20 | self.viewModel = viewModel 21 | 22 | super.init(nibName: nil, bundle: nil) 23 | } 24 | 25 | required init?(coder: NSCoder) { 26 | fatalError("init(coder:) has not been implemented") 27 | } 28 | 29 | public override func viewDidLoad() { 30 | view.backgroundColor = .blue 31 | 32 | addLabel() 33 | bindToViewModel() 34 | viewModel.loadData() 35 | } 36 | 37 | private func bindToViewModel() { 38 | viewModel.stateChanged = { [weak self] state in 39 | guard let self = self else { return } 40 | 41 | switch state { 42 | case .initial: 43 | break 44 | case .loadedData(let model): 45 | self.dataLabel.text = model.data 46 | } 47 | } 48 | } 49 | 50 | private func addLabel() { 51 | view.addSubview(dataLabel) 52 | dataLabel.translatesAutoresizingMaskIntoConstraints = false 53 | dataLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true 54 | dataLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/Packages/Feature2Module/Tests/Feature2ModuleTests/Feature2ModuleTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import Feature2Module 3 | 4 | final class Feature2ModuleTests: XCTestCase { 5 | func testExample() throws { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(Feature2Module().text, "Hello, World!") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/02. 6 | // 7 | 8 | import UIKit 9 | 10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | 21 | let appDependancyContainer = AppDependencyContainer() 22 | 23 | window?.backgroundColor = .clear 24 | window?.rootViewController = appDependancyContainer.makeMainViewController() 25 | } 26 | 27 | func sceneDidDisconnect(_ scene: UIScene) { 28 | // Called as the scene is being released by the system. 29 | // This occurs shortly after the scene enters the background, or when its session is discarded. 30 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 31 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 32 | } 33 | 34 | func sceneDidBecomeActive(_ scene: UIScene) { 35 | // Called when the scene has moved from an inactive state to an active state. 36 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 37 | } 38 | 39 | func sceneWillResignActive(_ scene: UIScene) { 40 | // Called when the scene will move from an active state to an inactive state. 41 | // This may occur due to temporary interruptions (ex. an incoming phone call). 42 | } 43 | 44 | func sceneWillEnterForeground(_ scene: UIScene) { 45 | // Called as the scene transitions from the background to the foreground. 46 | // Use this method to undo the changes made on entering the background. 47 | } 48 | 49 | func sceneDidEnterBackground(_ scene: UIScene) { 50 | // Called as the scene transitions from the foreground to the background. 51 | // Use this method to save data, release shared resources, and store enough scene-specific state information 52 | // to restore the scene back to its current state. 53 | } 54 | 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /ModularisationVertical/ModularisationVertical/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ModularisationVertical 4 | // 5 | // Created by Sashen Singh on 2022/10/02. 6 | // 7 | 8 | import UIKit 9 | 10 | class ViewController: UIViewController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | // Do any additional setup after loading the view. 15 | } 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vertical vs Horizontal modularisation in iOS 2 | 3 | The follow repository is based of the [medium article](https://medium.com/@sashensingh/modularisation-in-ios-using-swift-package-manager-and-some-approaches-we-may-take-vertical-vs-9e445ad72af3) and contains: 4 | 5 | - A **ModularisationStarter** folder with what an application could look like without modularisation done. 6 | - A **ModularisationHorizontal** folder with what the starter project could look like applying a horizontal modular structure using Swift Package Manager. This will look as follows 7 | 8 | ![hor](https://user-images.githubusercontent.com/3530948/198017213-120b65b8-0e52-45c2-9e2a-4dff121804e2.png) 9 | 10 | 11 | - A **ModularisationVertical** folder with what the starter project could look like applying a vertical modular structure using Swift Package Manager. This will look as follows 12 | 13 | ![vert](https://user-images.githubusercontent.com/3530948/198017254-a552927d-30c6-4d8e-ba6c-0c0eae0c20b2.png) 14 | 15 | Feel free to follow me on [Twitter](https://twitter.com/SashenSinghDev) :) 16 | 17 | # Prerequisites 18 | - Built using Xcode 13.4.1 19 | - Using swift-tools-version 5.5 20 | --------------------------------------------------------------------------------