├── .gitignore ├── App ├── App.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── App.xcscheme └── App │ ├── AppDelegate.swift │ ├── AppDependencies.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── first.imageset │ │ ├── Contents.json │ │ └── first.pdf │ └── second.imageset │ │ ├── Contents.json │ │ └── second.pdf │ ├── Base.lproj │ └── LaunchScreen.storyboard │ └── Info.plist ├── Common ├── Dependencies │ ├── Dependencies.xcodeproj │ │ └── project.pbxproj │ └── Dependencies │ │ ├── Chat.swift │ │ ├── Dependencies.h │ │ ├── Dependencies.swift │ │ ├── Info.plist │ │ └── UserProfile.swift ├── Service │ ├── Service.xcodeproj │ │ └── project.pbxproj │ └── Service │ │ ├── Info.plist │ │ ├── Model.swift │ │ └── Service.h └── Utils │ ├── Utils.xcodeproj │ └── project.pbxproj │ └── Utils │ ├── DependencyManager.swift │ ├── Info.plist │ └── Utils.h ├── Modules ├── Chat │ ├── Chat.xcodeproj │ │ └── project.pbxproj │ └── Chat │ │ ├── Chat.h │ │ ├── ChatModule.swift │ │ ├── ConversationsViewController.swift │ │ ├── Info.plist │ │ └── MessagesViewController.swift └── UserProfile │ ├── UserProfile.xcodeproj │ └── project.pbxproj │ └── UserProfile │ ├── Info.plist │ ├── UserProfile.h │ ├── UserProfileModule.swift │ └── UserProfileViewController.swift ├── MyFirstModule.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | -------------------------------------------------------------------------------- /App/App.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D463F5622318647000FB12F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D463F5522318647000FB12F /* AppDelegate.swift */; }; 11 | 3D463F5F22318647000FB12F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D463F5E22318647000FB12F /* Assets.xcassets */; }; 12 | 3D463F6222318647000FB12F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D463F6022318647000FB12F /* LaunchScreen.storyboard */; }; 13 | 3D463FC4223188EA000FB12F /* Service.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D463FC3223188EA000FB12F /* Service.framework */; }; 14 | 3D463FC6223188EA000FB12F /* Utils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D463FC5223188EA000FB12F /* Utils.framework */; }; 15 | 3D46401B22318FDF000FB12F /* AppDependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D46401A22318FDF000FB12F /* AppDependencies.swift */; }; 16 | 3D46402E223195A2000FB12F /* Chat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D46402D223195A2000FB12F /* Chat.framework */; }; 17 | 3D464030223195A2000FB12F /* Dependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D46402F223195A2000FB12F /* Dependencies.framework */; }; 18 | 3D464032223195A2000FB12F /* UserProfile.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D464031223195A2000FB12F /* UserProfile.framework */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 3D463F5222318647000FB12F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 3D463F5522318647000FB12F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 24 | 3D463F5E22318647000FB12F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 3D463F6122318647000FB12F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | 3D463F6322318647000FB12F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | 3D463FC3223188EA000FB12F /* Service.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Service.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 3D463FC5223188EA000FB12F /* Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 3D46401A22318FDF000FB12F /* AppDependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDependencies.swift; sourceTree = ""; }; 30 | 3D46402D223195A2000FB12F /* Chat.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Chat.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 3D46402F223195A2000FB12F /* Dependencies.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Dependencies.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 3D464031223195A2000FB12F /* UserProfile.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UserProfile.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 3D463F4F22318647000FB12F /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | 3D46402E223195A2000FB12F /* Chat.framework in Frameworks */, 41 | 3D464030223195A2000FB12F /* Dependencies.framework in Frameworks */, 42 | 3D464032223195A2000FB12F /* UserProfile.framework in Frameworks */, 43 | 3D463FC4223188EA000FB12F /* Service.framework in Frameworks */, 44 | 3D463FC6223188EA000FB12F /* Utils.framework in Frameworks */, 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 3D463F4922318647000FB12F = { 52 | isa = PBXGroup; 53 | children = ( 54 | 3D463F5422318647000FB12F /* App */, 55 | 3D463F5322318647000FB12F /* Products */, 56 | 3D463FC2223188EA000FB12F /* Frameworks */, 57 | ); 58 | sourceTree = ""; 59 | }; 60 | 3D463F5322318647000FB12F /* Products */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 3D463F5222318647000FB12F /* App.app */, 64 | ); 65 | name = Products; 66 | sourceTree = ""; 67 | }; 68 | 3D463F5422318647000FB12F /* App */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3D463F5522318647000FB12F /* AppDelegate.swift */, 72 | 3D46401A22318FDF000FB12F /* AppDependencies.swift */, 73 | 3D463F5E22318647000FB12F /* Assets.xcassets */, 74 | 3D463F6022318647000FB12F /* LaunchScreen.storyboard */, 75 | 3D463F6322318647000FB12F /* Info.plist */, 76 | ); 77 | path = App; 78 | sourceTree = ""; 79 | }; 80 | 3D463FC2223188EA000FB12F /* Frameworks */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 3D46402D223195A2000FB12F /* Chat.framework */, 84 | 3D46402F223195A2000FB12F /* Dependencies.framework */, 85 | 3D464031223195A2000FB12F /* UserProfile.framework */, 86 | 3D463FC3223188EA000FB12F /* Service.framework */, 87 | 3D463FC5223188EA000FB12F /* Utils.framework */, 88 | ); 89 | name = Frameworks; 90 | sourceTree = ""; 91 | }; 92 | /* End PBXGroup section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | 3D463F5122318647000FB12F /* App */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = 3D463F6622318647000FB12F /* Build configuration list for PBXNativeTarget "App" */; 98 | buildPhases = ( 99 | 3D463F4E22318647000FB12F /* Sources */, 100 | 3D463F4F22318647000FB12F /* Frameworks */, 101 | 3D463F5022318647000FB12F /* Resources */, 102 | ); 103 | buildRules = ( 104 | ); 105 | dependencies = ( 106 | ); 107 | name = App; 108 | productName = App; 109 | productReference = 3D463F5222318647000FB12F /* App.app */; 110 | productType = "com.apple.product-type.application"; 111 | }; 112 | /* End PBXNativeTarget section */ 113 | 114 | /* Begin PBXProject section */ 115 | 3D463F4A22318647000FB12F /* Project object */ = { 116 | isa = PBXProject; 117 | attributes = { 118 | LastSwiftUpdateCheck = 1010; 119 | LastUpgradeCheck = 1010; 120 | ORGANIZATIONNAME = Depop; 121 | TargetAttributes = { 122 | 3D463F5122318647000FB12F = { 123 | CreatedOnToolsVersion = 10.1; 124 | }; 125 | }; 126 | }; 127 | buildConfigurationList = 3D463F4D22318647000FB12F /* Build configuration list for PBXProject "App" */; 128 | compatibilityVersion = "Xcode 9.3"; 129 | developmentRegion = en; 130 | hasScannedForEncodings = 0; 131 | knownRegions = ( 132 | en, 133 | Base, 134 | ); 135 | mainGroup = 3D463F4922318647000FB12F; 136 | productRefGroup = 3D463F5322318647000FB12F /* Products */; 137 | projectDirPath = ""; 138 | projectRoot = ""; 139 | targets = ( 140 | 3D463F5122318647000FB12F /* App */, 141 | ); 142 | }; 143 | /* End PBXProject section */ 144 | 145 | /* Begin PBXResourcesBuildPhase section */ 146 | 3D463F5022318647000FB12F /* Resources */ = { 147 | isa = PBXResourcesBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | 3D463F6222318647000FB12F /* LaunchScreen.storyboard in Resources */, 151 | 3D463F5F22318647000FB12F /* Assets.xcassets in Resources */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXResourcesBuildPhase section */ 156 | 157 | /* Begin PBXSourcesBuildPhase section */ 158 | 3D463F4E22318647000FB12F /* Sources */ = { 159 | isa = PBXSourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 3D46401B22318FDF000FB12F /* AppDependencies.swift in Sources */, 163 | 3D463F5622318647000FB12F /* AppDelegate.swift in Sources */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXSourcesBuildPhase section */ 168 | 169 | /* Begin PBXVariantGroup section */ 170 | 3D463F6022318647000FB12F /* LaunchScreen.storyboard */ = { 171 | isa = PBXVariantGroup; 172 | children = ( 173 | 3D463F6122318647000FB12F /* Base */, 174 | ); 175 | name = LaunchScreen.storyboard; 176 | sourceTree = ""; 177 | }; 178 | /* End PBXVariantGroup section */ 179 | 180 | /* Begin XCBuildConfiguration section */ 181 | 3D463F6422318647000FB12F /* Debug */ = { 182 | isa = XCBuildConfiguration; 183 | buildSettings = { 184 | ALWAYS_SEARCH_USER_PATHS = NO; 185 | CLANG_ANALYZER_NONNULL = YES; 186 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 187 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 188 | CLANG_CXX_LIBRARY = "libc++"; 189 | CLANG_ENABLE_MODULES = YES; 190 | CLANG_ENABLE_OBJC_ARC = YES; 191 | CLANG_ENABLE_OBJC_WEAK = YES; 192 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 193 | CLANG_WARN_BOOL_CONVERSION = YES; 194 | CLANG_WARN_COMMA = YES; 195 | CLANG_WARN_CONSTANT_CONVERSION = YES; 196 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 197 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 198 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 199 | CLANG_WARN_EMPTY_BODY = YES; 200 | CLANG_WARN_ENUM_CONVERSION = YES; 201 | CLANG_WARN_INFINITE_RECURSION = YES; 202 | CLANG_WARN_INT_CONVERSION = YES; 203 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 204 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 205 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 206 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 207 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 208 | CLANG_WARN_STRICT_PROTOTYPES = YES; 209 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 210 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 211 | CLANG_WARN_UNREACHABLE_CODE = YES; 212 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 213 | CODE_SIGN_IDENTITY = "iPhone Developer"; 214 | COPY_PHASE_STRIP = NO; 215 | DEBUG_INFORMATION_FORMAT = dwarf; 216 | ENABLE_STRICT_OBJC_MSGSEND = YES; 217 | ENABLE_TESTABILITY = YES; 218 | GCC_C_LANGUAGE_STANDARD = gnu11; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_NO_COMMON_BLOCKS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 227 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 228 | GCC_WARN_UNDECLARED_SELECTOR = YES; 229 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 230 | GCC_WARN_UNUSED_FUNCTION = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 233 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 234 | MTL_FAST_MATH = YES; 235 | ONLY_ACTIVE_ARCH = YES; 236 | SDKROOT = iphoneos; 237 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 238 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 239 | }; 240 | name = Debug; 241 | }; 242 | 3D463F6522318647000FB12F /* Release */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | ALWAYS_SEARCH_USER_PATHS = NO; 246 | CLANG_ANALYZER_NONNULL = YES; 247 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 249 | CLANG_CXX_LIBRARY = "libc++"; 250 | CLANG_ENABLE_MODULES = YES; 251 | CLANG_ENABLE_OBJC_ARC = YES; 252 | CLANG_ENABLE_OBJC_WEAK = YES; 253 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 254 | CLANG_WARN_BOOL_CONVERSION = YES; 255 | CLANG_WARN_COMMA = YES; 256 | CLANG_WARN_CONSTANT_CONVERSION = YES; 257 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 258 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 259 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INFINITE_RECURSION = YES; 263 | CLANG_WARN_INT_CONVERSION = YES; 264 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 265 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 266 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 268 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 269 | CLANG_WARN_STRICT_PROTOTYPES = YES; 270 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 271 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 272 | CLANG_WARN_UNREACHABLE_CODE = YES; 273 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 274 | CODE_SIGN_IDENTITY = "iPhone Developer"; 275 | COPY_PHASE_STRIP = NO; 276 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 277 | ENABLE_NS_ASSERTIONS = NO; 278 | ENABLE_STRICT_OBJC_MSGSEND = YES; 279 | GCC_C_LANGUAGE_STANDARD = gnu11; 280 | GCC_NO_COMMON_BLOCKS = YES; 281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 283 | GCC_WARN_UNDECLARED_SELECTOR = YES; 284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 285 | GCC_WARN_UNUSED_FUNCTION = YES; 286 | GCC_WARN_UNUSED_VARIABLE = YES; 287 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 288 | MTL_ENABLE_DEBUG_INFO = NO; 289 | MTL_FAST_MATH = YES; 290 | SDKROOT = iphoneos; 291 | SWIFT_COMPILATION_MODE = wholemodule; 292 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 293 | VALIDATE_PRODUCT = YES; 294 | }; 295 | name = Release; 296 | }; 297 | 3D463F6722318647000FB12F /* Debug */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | CODE_SIGN_STYLE = Automatic; 302 | DEVELOPMENT_TEAM = ""; 303 | INFOPLIST_FILE = App/Info.plist; 304 | LD_RUNPATH_SEARCH_PATHS = ( 305 | "$(inherited)", 306 | "@executable_path/Frameworks", 307 | ); 308 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.App; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | SWIFT_VERSION = 4.2; 311 | TARGETED_DEVICE_FAMILY = "1,2"; 312 | }; 313 | name = Debug; 314 | }; 315 | 3D463F6822318647000FB12F /* Release */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 319 | CODE_SIGN_STYLE = Automatic; 320 | DEVELOPMENT_TEAM = ""; 321 | INFOPLIST_FILE = App/Info.plist; 322 | LD_RUNPATH_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "@executable_path/Frameworks", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.App; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | SWIFT_VERSION = 4.2; 329 | TARGETED_DEVICE_FAMILY = "1,2"; 330 | }; 331 | name = Release; 332 | }; 333 | /* End XCBuildConfiguration section */ 334 | 335 | /* Begin XCConfigurationList section */ 336 | 3D463F4D22318647000FB12F /* Build configuration list for PBXProject "App" */ = { 337 | isa = XCConfigurationList; 338 | buildConfigurations = ( 339 | 3D463F6422318647000FB12F /* Debug */, 340 | 3D463F6522318647000FB12F /* Release */, 341 | ); 342 | defaultConfigurationIsVisible = 0; 343 | defaultConfigurationName = Release; 344 | }; 345 | 3D463F6622318647000FB12F /* Build configuration list for PBXNativeTarget "App" */ = { 346 | isa = XCConfigurationList; 347 | buildConfigurations = ( 348 | 3D463F6722318647000FB12F /* Debug */, 349 | 3D463F6822318647000FB12F /* Release */, 350 | ); 351 | defaultConfigurationIsVisible = 0; 352 | defaultConfigurationName = Release; 353 | }; 354 | /* End XCConfigurationList section */ 355 | }; 356 | rootObject = 3D463F4A22318647000FB12F /* Project object */; 357 | } 358 | -------------------------------------------------------------------------------- /App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /App/App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // App 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dependencies 11 | import Service 12 | 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder, UIApplicationDelegate { 15 | 16 | var window: UIWindow? 17 | var tabBarController: UITabBarController? 18 | 19 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 20 | // Override point for customization after application launch. 21 | setUpDependencies() 22 | installMainScreen() 23 | return true 24 | } 25 | 26 | private func installMainScreen() { 27 | let window = UIWindow(frame: UIScreen.main.bounds) 28 | let tabBarController = UITabBarController(nibName: nil, bundle: nil) 29 | window.rootViewController = tabBarController 30 | window.makeKeyAndVisible() 31 | 32 | tabBarController.viewControllers = [ 33 | firstScreen(), 34 | secondScreen() 35 | ] 36 | 37 | self.window = window 38 | self.tabBarController = tabBarController 39 | } 40 | } 41 | 42 | private func currentUser() -> User { 43 | return User(identifier: "u") 44 | } 45 | 46 | private func firstScreen() -> UIViewController { 47 | let vc = embedInNav(Dependencies.shared.chatModule.conversationsScreen()) 48 | vc.tabBarItem.title = "Conversations" 49 | vc.tabBarItem.image = UIImage(named: "first") 50 | return vc 51 | } 52 | 53 | private func secondScreen() -> UIViewController { 54 | let vc = embedInNav(Dependencies.shared.userProfileModule.userProfileScreen(user: currentUser())) 55 | vc.tabBarItem.title = "My Profile" 56 | vc.tabBarItem.image = UIImage(named: "second") 57 | return vc 58 | } 59 | 60 | private func embedInNav(_ root: UIViewController) -> UINavigationController { 61 | return UINavigationController(rootViewController: root) 62 | } 63 | -------------------------------------------------------------------------------- /App/App/AppDependencies.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDependencies.swift 3 | // App 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dependencies 11 | import Chat 12 | import UserProfile 13 | 14 | func setUpDependencies() { 15 | // register dependencies here 16 | let dependencies = Dependencies.shared 17 | 18 | dependencies.register(ChatModuleProtocol.self) { 19 | return ChatModule() 20 | } 21 | dependencies.register(UserProfileModuleProtocol.self) { 22 | return UserProfileModule() 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /App/App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /App/App/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /App/App/Assets.xcassets/first.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "first.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /App/App/Assets.xcassets/first.imageset/first.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/depop-archive/archived-my-first-module/609b2847b8ab1df90e704670120956ab5039debb/App/App/Assets.xcassets/first.imageset/first.pdf -------------------------------------------------------------------------------- /App/App/Assets.xcassets/second.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "second.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /App/App/Assets.xcassets/second.imageset/second.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/depop-archive/archived-my-first-module/609b2847b8ab1df90e704670120956ab5039debb/App/App/Assets.xcassets/second.imageset/second.pdf -------------------------------------------------------------------------------- /App/App/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 | -------------------------------------------------------------------------------- /App/App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UIStatusBarTintParameters 30 | 31 | UINavigationBar 32 | 33 | Style 34 | UIBarStyleDefault 35 | Translucent 36 | 37 | 38 | 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationLandscapeLeft 43 | UIInterfaceOrientationLandscapeRight 44 | 45 | UISupportedInterfaceOrientations~ipad 46 | 47 | UIInterfaceOrientationPortrait 48 | UIInterfaceOrientationPortraitUpsideDown 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Common/Dependencies/Dependencies.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D46400722318AC2000FB12F /* Dependencies.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D46400522318AC2000FB12F /* Dependencies.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 3D46401922318F6C000FB12F /* Dependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D46401822318F6C000FB12F /* Dependencies.swift */; }; 12 | 3D46401D2231901D000FB12F /* Chat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D46401C2231901D000FB12F /* Chat.swift */; }; 13 | 3D46402222319060000FB12F /* Service.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D46402122319060000FB12F /* Service.framework */; }; 14 | 3D46402A2231945D000FB12F /* UserProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D4640292231945D000FB12F /* UserProfile.swift */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 3D46400222318AC2000FB12F /* Dependencies.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Dependencies.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 3D46400522318AC2000FB12F /* Dependencies.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Dependencies.h; sourceTree = ""; }; 20 | 3D46400622318AC2000FB12F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 21 | 3D46401822318F6C000FB12F /* Dependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dependencies.swift; sourceTree = ""; }; 22 | 3D46401C2231901D000FB12F /* Chat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Chat.swift; sourceTree = ""; }; 23 | 3D46402122319060000FB12F /* Service.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Service.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 3D4640292231945D000FB12F /* UserProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfile.swift; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | 3D463FFF22318AC2000FB12F /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | 3D46402222319060000FB12F /* Service.framework in Frameworks */, 33 | ); 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXFrameworksBuildPhase section */ 37 | 38 | /* Begin PBXGroup section */ 39 | 3D463FF822318AC2000FB12F = { 40 | isa = PBXGroup; 41 | children = ( 42 | 3D46400422318AC2000FB12F /* Dependencies */, 43 | 3D46400322318AC2000FB12F /* Products */, 44 | 3D46402022319060000FB12F /* Frameworks */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 3D46400322318AC2000FB12F /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 3D46400222318AC2000FB12F /* Dependencies.framework */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 3D46400422318AC2000FB12F /* Dependencies */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 3D46400522318AC2000FB12F /* Dependencies.h */, 60 | 3D46401822318F6C000FB12F /* Dependencies.swift */, 61 | 3D46401C2231901D000FB12F /* Chat.swift */, 62 | 3D4640292231945D000FB12F /* UserProfile.swift */, 63 | 3D46400622318AC2000FB12F /* Info.plist */, 64 | ); 65 | path = Dependencies; 66 | sourceTree = ""; 67 | }; 68 | 3D46402022319060000FB12F /* Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3D46402122319060000FB12F /* Service.framework */, 72 | ); 73 | name = Frameworks; 74 | sourceTree = ""; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXHeadersBuildPhase section */ 79 | 3D463FFD22318AC2000FB12F /* Headers */ = { 80 | isa = PBXHeadersBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | 3D46400722318AC2000FB12F /* Dependencies.h in Headers */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXHeadersBuildPhase section */ 88 | 89 | /* Begin PBXNativeTarget section */ 90 | 3D46400122318AC2000FB12F /* Dependencies */ = { 91 | isa = PBXNativeTarget; 92 | buildConfigurationList = 3D46400A22318AC2000FB12F /* Build configuration list for PBXNativeTarget "Dependencies" */; 93 | buildPhases = ( 94 | 3D463FFD22318AC2000FB12F /* Headers */, 95 | 3D463FFE22318AC2000FB12F /* Sources */, 96 | 3D463FFF22318AC2000FB12F /* Frameworks */, 97 | 3D46400022318AC2000FB12F /* Resources */, 98 | ); 99 | buildRules = ( 100 | ); 101 | dependencies = ( 102 | ); 103 | name = Dependencies; 104 | productName = Dependencies; 105 | productReference = 3D46400222318AC2000FB12F /* Dependencies.framework */; 106 | productType = "com.apple.product-type.framework"; 107 | }; 108 | /* End PBXNativeTarget section */ 109 | 110 | /* Begin PBXProject section */ 111 | 3D463FF922318AC2000FB12F /* Project object */ = { 112 | isa = PBXProject; 113 | attributes = { 114 | LastUpgradeCheck = 1010; 115 | ORGANIZATIONNAME = Depop; 116 | TargetAttributes = { 117 | 3D46400122318AC2000FB12F = { 118 | CreatedOnToolsVersion = 10.1; 119 | LastSwiftMigration = 1010; 120 | }; 121 | }; 122 | }; 123 | buildConfigurationList = 3D463FFC22318AC2000FB12F /* Build configuration list for PBXProject "Dependencies" */; 124 | compatibilityVersion = "Xcode 9.3"; 125 | developmentRegion = en; 126 | hasScannedForEncodings = 0; 127 | knownRegions = ( 128 | en, 129 | ); 130 | mainGroup = 3D463FF822318AC2000FB12F; 131 | productRefGroup = 3D46400322318AC2000FB12F /* Products */; 132 | projectDirPath = ""; 133 | projectRoot = ""; 134 | targets = ( 135 | 3D46400122318AC2000FB12F /* Dependencies */, 136 | ); 137 | }; 138 | /* End PBXProject section */ 139 | 140 | /* Begin PBXResourcesBuildPhase section */ 141 | 3D46400022318AC2000FB12F /* Resources */ = { 142 | isa = PBXResourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXResourcesBuildPhase section */ 149 | 150 | /* Begin PBXSourcesBuildPhase section */ 151 | 3D463FFE22318AC2000FB12F /* Sources */ = { 152 | isa = PBXSourcesBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | 3D46401922318F6C000FB12F /* Dependencies.swift in Sources */, 156 | 3D46401D2231901D000FB12F /* Chat.swift in Sources */, 157 | 3D46402A2231945D000FB12F /* UserProfile.swift in Sources */, 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | /* End PBXSourcesBuildPhase section */ 162 | 163 | /* Begin XCBuildConfiguration section */ 164 | 3D46400822318AC2000FB12F /* Debug */ = { 165 | isa = XCBuildConfiguration; 166 | buildSettings = { 167 | ALWAYS_SEARCH_USER_PATHS = NO; 168 | CLANG_ANALYZER_NONNULL = YES; 169 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 170 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 171 | CLANG_CXX_LIBRARY = "libc++"; 172 | CLANG_ENABLE_MODULES = YES; 173 | CLANG_ENABLE_OBJC_ARC = YES; 174 | CLANG_ENABLE_OBJC_WEAK = YES; 175 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 176 | CLANG_WARN_BOOL_CONVERSION = YES; 177 | CLANG_WARN_COMMA = YES; 178 | CLANG_WARN_CONSTANT_CONVERSION = YES; 179 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 180 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 181 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 182 | CLANG_WARN_EMPTY_BODY = YES; 183 | CLANG_WARN_ENUM_CONVERSION = YES; 184 | CLANG_WARN_INFINITE_RECURSION = YES; 185 | CLANG_WARN_INT_CONVERSION = YES; 186 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 187 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 188 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 189 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 190 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 191 | CLANG_WARN_STRICT_PROTOTYPES = YES; 192 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 193 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 194 | CLANG_WARN_UNREACHABLE_CODE = YES; 195 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 196 | CODE_SIGN_IDENTITY = "iPhone Developer"; 197 | COPY_PHASE_STRIP = NO; 198 | CURRENT_PROJECT_VERSION = 1; 199 | DEBUG_INFORMATION_FORMAT = dwarf; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | ENABLE_TESTABILITY = YES; 202 | GCC_C_LANGUAGE_STANDARD = gnu11; 203 | GCC_DYNAMIC_NO_PIC = NO; 204 | GCC_NO_COMMON_BLOCKS = YES; 205 | GCC_OPTIMIZATION_LEVEL = 0; 206 | GCC_PREPROCESSOR_DEFINITIONS = ( 207 | "DEBUG=1", 208 | "$(inherited)", 209 | ); 210 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 211 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 212 | GCC_WARN_UNDECLARED_SELECTOR = YES; 213 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 214 | GCC_WARN_UNUSED_FUNCTION = YES; 215 | GCC_WARN_UNUSED_VARIABLE = YES; 216 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 217 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 218 | MTL_FAST_MATH = YES; 219 | ONLY_ACTIVE_ARCH = YES; 220 | SDKROOT = iphoneos; 221 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 222 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 223 | VERSIONING_SYSTEM = "apple-generic"; 224 | VERSION_INFO_PREFIX = ""; 225 | }; 226 | name = Debug; 227 | }; 228 | 3D46400922318AC2000FB12F /* Release */ = { 229 | isa = XCBuildConfiguration; 230 | buildSettings = { 231 | ALWAYS_SEARCH_USER_PATHS = NO; 232 | CLANG_ANALYZER_NONNULL = YES; 233 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 234 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 235 | CLANG_CXX_LIBRARY = "libc++"; 236 | CLANG_ENABLE_MODULES = YES; 237 | CLANG_ENABLE_OBJC_ARC = YES; 238 | CLANG_ENABLE_OBJC_WEAK = YES; 239 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 240 | CLANG_WARN_BOOL_CONVERSION = YES; 241 | CLANG_WARN_COMMA = YES; 242 | CLANG_WARN_CONSTANT_CONVERSION = YES; 243 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 244 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 245 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 246 | CLANG_WARN_EMPTY_BODY = YES; 247 | CLANG_WARN_ENUM_CONVERSION = YES; 248 | CLANG_WARN_INFINITE_RECURSION = YES; 249 | CLANG_WARN_INT_CONVERSION = YES; 250 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 251 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 252 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 253 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 254 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 255 | CLANG_WARN_STRICT_PROTOTYPES = YES; 256 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 257 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 258 | CLANG_WARN_UNREACHABLE_CODE = YES; 259 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 260 | CODE_SIGN_IDENTITY = "iPhone Developer"; 261 | COPY_PHASE_STRIP = NO; 262 | CURRENT_PROJECT_VERSION = 1; 263 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 264 | ENABLE_NS_ASSERTIONS = NO; 265 | ENABLE_STRICT_OBJC_MSGSEND = YES; 266 | GCC_C_LANGUAGE_STANDARD = gnu11; 267 | GCC_NO_COMMON_BLOCKS = YES; 268 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 269 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 270 | GCC_WARN_UNDECLARED_SELECTOR = YES; 271 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 272 | GCC_WARN_UNUSED_FUNCTION = YES; 273 | GCC_WARN_UNUSED_VARIABLE = YES; 274 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 275 | MTL_ENABLE_DEBUG_INFO = NO; 276 | MTL_FAST_MATH = YES; 277 | SDKROOT = iphoneos; 278 | SWIFT_COMPILATION_MODE = wholemodule; 279 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 280 | VALIDATE_PRODUCT = YES; 281 | VERSIONING_SYSTEM = "apple-generic"; 282 | VERSION_INFO_PREFIX = ""; 283 | }; 284 | name = Release; 285 | }; 286 | 3D46400B22318AC2000FB12F /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | CLANG_ENABLE_MODULES = YES; 290 | CODE_SIGN_IDENTITY = ""; 291 | CODE_SIGN_STYLE = Automatic; 292 | DEFINES_MODULE = YES; 293 | DYLIB_COMPATIBILITY_VERSION = 1; 294 | DYLIB_CURRENT_VERSION = 1; 295 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 296 | INFOPLIST_FILE = Dependencies/Info.plist; 297 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 298 | LD_RUNPATH_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "@executable_path/Frameworks", 301 | "@loader_path/Frameworks", 302 | ); 303 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Dependencies; 304 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 305 | SKIP_INSTALL = YES; 306 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 307 | SWIFT_VERSION = 4.2; 308 | TARGETED_DEVICE_FAMILY = "1,2"; 309 | }; 310 | name = Debug; 311 | }; 312 | 3D46400C22318AC2000FB12F /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | CLANG_ENABLE_MODULES = YES; 316 | CODE_SIGN_IDENTITY = ""; 317 | CODE_SIGN_STYLE = Automatic; 318 | DEFINES_MODULE = YES; 319 | DYLIB_COMPATIBILITY_VERSION = 1; 320 | DYLIB_CURRENT_VERSION = 1; 321 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 322 | INFOPLIST_FILE = Dependencies/Info.plist; 323 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 324 | LD_RUNPATH_SEARCH_PATHS = ( 325 | "$(inherited)", 326 | "@executable_path/Frameworks", 327 | "@loader_path/Frameworks", 328 | ); 329 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Dependencies; 330 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 331 | SKIP_INSTALL = YES; 332 | SWIFT_VERSION = 4.2; 333 | TARGETED_DEVICE_FAMILY = "1,2"; 334 | }; 335 | name = Release; 336 | }; 337 | /* End XCBuildConfiguration section */ 338 | 339 | /* Begin XCConfigurationList section */ 340 | 3D463FFC22318AC2000FB12F /* Build configuration list for PBXProject "Dependencies" */ = { 341 | isa = XCConfigurationList; 342 | buildConfigurations = ( 343 | 3D46400822318AC2000FB12F /* Debug */, 344 | 3D46400922318AC2000FB12F /* Release */, 345 | ); 346 | defaultConfigurationIsVisible = 0; 347 | defaultConfigurationName = Release; 348 | }; 349 | 3D46400A22318AC2000FB12F /* Build configuration list for PBXNativeTarget "Dependencies" */ = { 350 | isa = XCConfigurationList; 351 | buildConfigurations = ( 352 | 3D46400B22318AC2000FB12F /* Debug */, 353 | 3D46400C22318AC2000FB12F /* Release */, 354 | ); 355 | defaultConfigurationIsVisible = 0; 356 | defaultConfigurationName = Release; 357 | }; 358 | /* End XCConfigurationList section */ 359 | }; 360 | rootObject = 3D463FF922318AC2000FB12F /* Project object */; 361 | } 362 | -------------------------------------------------------------------------------- /Common/Dependencies/Dependencies/Chat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Chat.swift 3 | // Dependencies 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Service 11 | 12 | public protocol ChatModuleProtocol { 13 | // Returns a new view controller used to show a list of conversations 14 | func conversationsScreen() -> UIViewController 15 | // Returns a new view controller used to chat with a user about a product (optional) 16 | func messagesScreen(user: User, product: Product?) -> UIViewController 17 | // Returns a new object which can be used to send a message on the background. See ChatMessageSender for more info. 18 | func messageSender(to receiver: User, about product: Product?) -> ChatMessageSender 19 | } 20 | 21 | // An object which can be used to send messages about a particular conversation. 22 | public protocol ChatMessageSender { 23 | // Sends a new message with a body. The completion handler will be called upon completion. In case of success with a valid identifier for the new message created. 24 | func sendNewMessage(with body: String, completion: @escaping (_ messageId: String?) -> Void) 25 | } 26 | 27 | extension Dependencies { 28 | // Now we can obtain a ChatModule 29 | public var chatModule: ChatModuleProtocol { 30 | return resolve(ChatModuleProtocol.self)! 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Common/Dependencies/Dependencies/Dependencies.h: -------------------------------------------------------------------------------- 1 | // 2 | // Dependencies.h 3 | // Dependencies 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Dependencies. 12 | FOUNDATION_EXPORT double DependenciesVersionNumber; 13 | 14 | //! Project version string for Dependencies. 15 | FOUNDATION_EXPORT const unsigned char DependenciesVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Common/Dependencies/Dependencies/Dependencies.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dependencies.swift 3 | // Dependencies 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import Utils 10 | 11 | public final class Dependencies: DependencyManager { 12 | // We expose this to every modules via a singleton 13 | public static let shared = Dependencies() 14 | } 15 | -------------------------------------------------------------------------------- /Common/Dependencies/Dependencies/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Common/Dependencies/Dependencies/UserProfile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserProfile.swift 3 | // Dependencies 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Service 11 | 12 | public protocol UserProfileModuleProtocol { 13 | func userProfileScreen(user: User) -> UIViewController 14 | } 15 | 16 | extension Dependencies { 17 | // Now we can obtain a ChatModule 18 | public var userProfileModule: UserProfileModuleProtocol { 19 | return resolve(UserProfileModuleProtocol.self)! 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Common/Service/Service.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D463FB92231882F000FB12F /* Service.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D463FB72231882F000FB12F /* Service.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 3D463FC8223188F0000FB12F /* Utils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D463FC7223188F0000FB12F /* Utils.framework */; }; 12 | 3D46401F2231903A000FB12F /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D46401E2231903A000FB12F /* Model.swift */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | 3D463FB42231882F000FB12F /* Service.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Service.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | 3D463FB72231882F000FB12F /* Service.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Service.h; sourceTree = ""; }; 18 | 3D463FB82231882F000FB12F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 19 | 3D463FC02231884B000FB12F /* Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 3D463FC7223188F0000FB12F /* Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 3D46401E2231903A000FB12F /* Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = ""; }; 22 | /* End PBXFileReference section */ 23 | 24 | /* Begin PBXFrameworksBuildPhase section */ 25 | 3D463FB12231882F000FB12F /* Frameworks */ = { 26 | isa = PBXFrameworksBuildPhase; 27 | buildActionMask = 2147483647; 28 | files = ( 29 | 3D463FC8223188F0000FB12F /* Utils.framework in Frameworks */, 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | 3D463FAA2231882F000FB12F = { 37 | isa = PBXGroup; 38 | children = ( 39 | 3D463FB62231882F000FB12F /* Service */, 40 | 3D463FB52231882F000FB12F /* Products */, 41 | 3D463FBF2231884B000FB12F /* Frameworks */, 42 | ); 43 | sourceTree = ""; 44 | }; 45 | 3D463FB52231882F000FB12F /* Products */ = { 46 | isa = PBXGroup; 47 | children = ( 48 | 3D463FB42231882F000FB12F /* Service.framework */, 49 | ); 50 | name = Products; 51 | sourceTree = ""; 52 | }; 53 | 3D463FB62231882F000FB12F /* Service */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 3D463FB72231882F000FB12F /* Service.h */, 57 | 3D46401E2231903A000FB12F /* Model.swift */, 58 | 3D463FB82231882F000FB12F /* Info.plist */, 59 | ); 60 | path = Service; 61 | sourceTree = ""; 62 | }; 63 | 3D463FBF2231884B000FB12F /* Frameworks */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | 3D463FC7223188F0000FB12F /* Utils.framework */, 67 | 3D463FC02231884B000FB12F /* Utils.framework */, 68 | ); 69 | name = Frameworks; 70 | sourceTree = ""; 71 | }; 72 | /* End PBXGroup section */ 73 | 74 | /* Begin PBXHeadersBuildPhase section */ 75 | 3D463FAF2231882F000FB12F /* Headers */ = { 76 | isa = PBXHeadersBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | 3D463FB92231882F000FB12F /* Service.h in Headers */, 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXHeadersBuildPhase section */ 84 | 85 | /* Begin PBXNativeTarget section */ 86 | 3D463FB32231882F000FB12F /* Service */ = { 87 | isa = PBXNativeTarget; 88 | buildConfigurationList = 3D463FBC2231882F000FB12F /* Build configuration list for PBXNativeTarget "Service" */; 89 | buildPhases = ( 90 | 3D463FAF2231882F000FB12F /* Headers */, 91 | 3D463FB02231882F000FB12F /* Sources */, 92 | 3D463FB12231882F000FB12F /* Frameworks */, 93 | 3D463FB22231882F000FB12F /* Resources */, 94 | ); 95 | buildRules = ( 96 | ); 97 | dependencies = ( 98 | ); 99 | name = Service; 100 | productName = Service; 101 | productReference = 3D463FB42231882F000FB12F /* Service.framework */; 102 | productType = "com.apple.product-type.framework"; 103 | }; 104 | /* End PBXNativeTarget section */ 105 | 106 | /* Begin PBXProject section */ 107 | 3D463FAB2231882F000FB12F /* Project object */ = { 108 | isa = PBXProject; 109 | attributes = { 110 | LastUpgradeCheck = 1010; 111 | ORGANIZATIONNAME = Depop; 112 | TargetAttributes = { 113 | 3D463FB32231882F000FB12F = { 114 | CreatedOnToolsVersion = 10.1; 115 | LastSwiftMigration = 1010; 116 | }; 117 | }; 118 | }; 119 | buildConfigurationList = 3D463FAE2231882F000FB12F /* Build configuration list for PBXProject "Service" */; 120 | compatibilityVersion = "Xcode 9.3"; 121 | developmentRegion = en; 122 | hasScannedForEncodings = 0; 123 | knownRegions = ( 124 | en, 125 | ); 126 | mainGroup = 3D463FAA2231882F000FB12F; 127 | productRefGroup = 3D463FB52231882F000FB12F /* Products */; 128 | projectDirPath = ""; 129 | projectRoot = ""; 130 | targets = ( 131 | 3D463FB32231882F000FB12F /* Service */, 132 | ); 133 | }; 134 | /* End PBXProject section */ 135 | 136 | /* Begin PBXResourcesBuildPhase section */ 137 | 3D463FB22231882F000FB12F /* Resources */ = { 138 | isa = PBXResourcesBuildPhase; 139 | buildActionMask = 2147483647; 140 | files = ( 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | /* End PBXResourcesBuildPhase section */ 145 | 146 | /* Begin PBXSourcesBuildPhase section */ 147 | 3D463FB02231882F000FB12F /* Sources */ = { 148 | isa = PBXSourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | 3D46401F2231903A000FB12F /* Model.swift in Sources */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXSourcesBuildPhase section */ 156 | 157 | /* Begin XCBuildConfiguration section */ 158 | 3D463FBA2231882F000FB12F /* Debug */ = { 159 | isa = XCBuildConfiguration; 160 | buildSettings = { 161 | ALWAYS_SEARCH_USER_PATHS = NO; 162 | CLANG_ANALYZER_NONNULL = YES; 163 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 164 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 165 | CLANG_CXX_LIBRARY = "libc++"; 166 | CLANG_ENABLE_MODULES = YES; 167 | CLANG_ENABLE_OBJC_ARC = YES; 168 | CLANG_ENABLE_OBJC_WEAK = YES; 169 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 170 | CLANG_WARN_BOOL_CONVERSION = YES; 171 | CLANG_WARN_COMMA = YES; 172 | CLANG_WARN_CONSTANT_CONVERSION = YES; 173 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 174 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 175 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 176 | CLANG_WARN_EMPTY_BODY = YES; 177 | CLANG_WARN_ENUM_CONVERSION = YES; 178 | CLANG_WARN_INFINITE_RECURSION = YES; 179 | CLANG_WARN_INT_CONVERSION = YES; 180 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 181 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 182 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 183 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 184 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 185 | CLANG_WARN_STRICT_PROTOTYPES = YES; 186 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 187 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 188 | CLANG_WARN_UNREACHABLE_CODE = YES; 189 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 190 | CODE_SIGN_IDENTITY = "iPhone Developer"; 191 | COPY_PHASE_STRIP = NO; 192 | CURRENT_PROJECT_VERSION = 1; 193 | DEBUG_INFORMATION_FORMAT = dwarf; 194 | ENABLE_STRICT_OBJC_MSGSEND = YES; 195 | ENABLE_TESTABILITY = YES; 196 | GCC_C_LANGUAGE_STANDARD = gnu11; 197 | GCC_DYNAMIC_NO_PIC = NO; 198 | GCC_NO_COMMON_BLOCKS = YES; 199 | GCC_OPTIMIZATION_LEVEL = 0; 200 | GCC_PREPROCESSOR_DEFINITIONS = ( 201 | "DEBUG=1", 202 | "$(inherited)", 203 | ); 204 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 205 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 206 | GCC_WARN_UNDECLARED_SELECTOR = YES; 207 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 208 | GCC_WARN_UNUSED_FUNCTION = YES; 209 | GCC_WARN_UNUSED_VARIABLE = YES; 210 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 211 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 212 | MTL_FAST_MATH = YES; 213 | ONLY_ACTIVE_ARCH = YES; 214 | SDKROOT = iphoneos; 215 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 216 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 217 | VERSIONING_SYSTEM = "apple-generic"; 218 | VERSION_INFO_PREFIX = ""; 219 | }; 220 | name = Debug; 221 | }; 222 | 3D463FBB2231882F000FB12F /* Release */ = { 223 | isa = XCBuildConfiguration; 224 | buildSettings = { 225 | ALWAYS_SEARCH_USER_PATHS = NO; 226 | CLANG_ANALYZER_NONNULL = YES; 227 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 228 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 229 | CLANG_CXX_LIBRARY = "libc++"; 230 | CLANG_ENABLE_MODULES = YES; 231 | CLANG_ENABLE_OBJC_ARC = YES; 232 | CLANG_ENABLE_OBJC_WEAK = YES; 233 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 234 | CLANG_WARN_BOOL_CONVERSION = YES; 235 | CLANG_WARN_COMMA = YES; 236 | CLANG_WARN_CONSTANT_CONVERSION = YES; 237 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 238 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 239 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 240 | CLANG_WARN_EMPTY_BODY = YES; 241 | CLANG_WARN_ENUM_CONVERSION = YES; 242 | CLANG_WARN_INFINITE_RECURSION = YES; 243 | CLANG_WARN_INT_CONVERSION = YES; 244 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 245 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 246 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 247 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 248 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 249 | CLANG_WARN_STRICT_PROTOTYPES = YES; 250 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 251 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 252 | CLANG_WARN_UNREACHABLE_CODE = YES; 253 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 254 | CODE_SIGN_IDENTITY = "iPhone Developer"; 255 | COPY_PHASE_STRIP = NO; 256 | CURRENT_PROJECT_VERSION = 1; 257 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 258 | ENABLE_NS_ASSERTIONS = NO; 259 | ENABLE_STRICT_OBJC_MSGSEND = YES; 260 | GCC_C_LANGUAGE_STANDARD = gnu11; 261 | GCC_NO_COMMON_BLOCKS = YES; 262 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 263 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 264 | GCC_WARN_UNDECLARED_SELECTOR = YES; 265 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 266 | GCC_WARN_UNUSED_FUNCTION = YES; 267 | GCC_WARN_UNUSED_VARIABLE = YES; 268 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 269 | MTL_ENABLE_DEBUG_INFO = NO; 270 | MTL_FAST_MATH = YES; 271 | SDKROOT = iphoneos; 272 | SWIFT_COMPILATION_MODE = wholemodule; 273 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 274 | VALIDATE_PRODUCT = YES; 275 | VERSIONING_SYSTEM = "apple-generic"; 276 | VERSION_INFO_PREFIX = ""; 277 | }; 278 | name = Release; 279 | }; 280 | 3D463FBD2231882F000FB12F /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | CLANG_ENABLE_MODULES = YES; 284 | CODE_SIGN_IDENTITY = ""; 285 | CODE_SIGN_STYLE = Automatic; 286 | DEFINES_MODULE = YES; 287 | DYLIB_COMPATIBILITY_VERSION = 1; 288 | DYLIB_CURRENT_VERSION = 1; 289 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 290 | INFOPLIST_FILE = Service/Info.plist; 291 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 292 | LD_RUNPATH_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "@executable_path/Frameworks", 295 | "@loader_path/Frameworks", 296 | ); 297 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Service; 298 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 299 | SKIP_INSTALL = YES; 300 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 301 | SWIFT_VERSION = 4.2; 302 | TARGETED_DEVICE_FAMILY = "1,2"; 303 | }; 304 | name = Debug; 305 | }; 306 | 3D463FBE2231882F000FB12F /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | CLANG_ENABLE_MODULES = YES; 310 | CODE_SIGN_IDENTITY = ""; 311 | CODE_SIGN_STYLE = Automatic; 312 | DEFINES_MODULE = YES; 313 | DYLIB_COMPATIBILITY_VERSION = 1; 314 | DYLIB_CURRENT_VERSION = 1; 315 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 316 | INFOPLIST_FILE = Service/Info.plist; 317 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 318 | LD_RUNPATH_SEARCH_PATHS = ( 319 | "$(inherited)", 320 | "@executable_path/Frameworks", 321 | "@loader_path/Frameworks", 322 | ); 323 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Service; 324 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 325 | SKIP_INSTALL = YES; 326 | SWIFT_VERSION = 4.2; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | }; 329 | name = Release; 330 | }; 331 | /* End XCBuildConfiguration section */ 332 | 333 | /* Begin XCConfigurationList section */ 334 | 3D463FAE2231882F000FB12F /* Build configuration list for PBXProject "Service" */ = { 335 | isa = XCConfigurationList; 336 | buildConfigurations = ( 337 | 3D463FBA2231882F000FB12F /* Debug */, 338 | 3D463FBB2231882F000FB12F /* Release */, 339 | ); 340 | defaultConfigurationIsVisible = 0; 341 | defaultConfigurationName = Release; 342 | }; 343 | 3D463FBC2231882F000FB12F /* Build configuration list for PBXNativeTarget "Service" */ = { 344 | isa = XCConfigurationList; 345 | buildConfigurations = ( 346 | 3D463FBD2231882F000FB12F /* Debug */, 347 | 3D463FBE2231882F000FB12F /* Release */, 348 | ); 349 | defaultConfigurationIsVisible = 0; 350 | defaultConfigurationName = Release; 351 | }; 352 | /* End XCConfigurationList section */ 353 | }; 354 | rootObject = 3D463FAB2231882F000FB12F /* Project object */; 355 | } 356 | -------------------------------------------------------------------------------- /Common/Service/Service/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Common/Service/Service/Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // User.swift 3 | // Service 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public struct User { 12 | public let identifier: String 13 | 14 | public init(identifier: String) { 15 | self.identifier = identifier 16 | } 17 | } 18 | 19 | public struct Product { 20 | public let identifier: String 21 | 22 | public init(identifier: String) { 23 | self.identifier = identifier 24 | } 25 | } 26 | 27 | extension User: CustomDebugStringConvertible { 28 | public var debugDescription: String { 29 | return "" 30 | } 31 | } 32 | 33 | extension Product: CustomDebugStringConvertible { 34 | public var debugDescription: String { 35 | return "" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Common/Service/Service/Service.h: -------------------------------------------------------------------------------- 1 | // 2 | // Service.h 3 | // Service 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Service. 12 | FOUNDATION_EXPORT double ServiceVersionNumber; 13 | 14 | //! Project version string for Service. 15 | FOUNDATION_EXPORT const unsigned char ServiceVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Common/Utils/Utils.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D463F8D223187A3000FB12F /* Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D463F8B223187A3000FB12F /* Utils.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 3D46401722318EEA000FB12F /* DependencyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D46401622318EEA000FB12F /* DependencyManager.swift */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXFileReference section */ 15 | 3D463F88223187A3000FB12F /* Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 16 | 3D463F8B223187A3000FB12F /* Utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Utils.h; sourceTree = ""; }; 17 | 3D463F8C223187A3000FB12F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18 | 3D46401622318EEA000FB12F /* DependencyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DependencyManager.swift; sourceTree = ""; }; 19 | /* End PBXFileReference section */ 20 | 21 | /* Begin PBXFrameworksBuildPhase section */ 22 | 3D463F85223187A3000FB12F /* Frameworks */ = { 23 | isa = PBXFrameworksBuildPhase; 24 | buildActionMask = 2147483647; 25 | files = ( 26 | ); 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXFrameworksBuildPhase section */ 30 | 31 | /* Begin PBXGroup section */ 32 | 3D463F7E223187A3000FB12F = { 33 | isa = PBXGroup; 34 | children = ( 35 | 3D463F8A223187A3000FB12F /* Utils */, 36 | 3D463F89223187A3000FB12F /* Products */, 37 | ); 38 | sourceTree = ""; 39 | }; 40 | 3D463F89223187A3000FB12F /* Products */ = { 41 | isa = PBXGroup; 42 | children = ( 43 | 3D463F88223187A3000FB12F /* Utils.framework */, 44 | ); 45 | name = Products; 46 | sourceTree = ""; 47 | }; 48 | 3D463F8A223187A3000FB12F /* Utils */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 3D463F8B223187A3000FB12F /* Utils.h */, 52 | 3D463F8C223187A3000FB12F /* Info.plist */, 53 | 3D46401622318EEA000FB12F /* DependencyManager.swift */, 54 | ); 55 | path = Utils; 56 | sourceTree = ""; 57 | }; 58 | /* End PBXGroup section */ 59 | 60 | /* Begin PBXHeadersBuildPhase section */ 61 | 3D463F83223187A3000FB12F /* Headers */ = { 62 | isa = PBXHeadersBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 3D463F8D223187A3000FB12F /* Utils.h in Headers */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXHeadersBuildPhase section */ 70 | 71 | /* Begin PBXNativeTarget section */ 72 | 3D463F87223187A3000FB12F /* Utils */ = { 73 | isa = PBXNativeTarget; 74 | buildConfigurationList = 3D463F90223187A3000FB12F /* Build configuration list for PBXNativeTarget "Utils" */; 75 | buildPhases = ( 76 | 3D463F83223187A3000FB12F /* Headers */, 77 | 3D463F84223187A3000FB12F /* Sources */, 78 | 3D463F85223187A3000FB12F /* Frameworks */, 79 | 3D463F86223187A3000FB12F /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = Utils; 86 | productName = Utils; 87 | productReference = 3D463F88223187A3000FB12F /* Utils.framework */; 88 | productType = "com.apple.product-type.framework"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 3D463F7F223187A3000FB12F /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | LastUpgradeCheck = 1010; 97 | ORGANIZATIONNAME = Depop; 98 | TargetAttributes = { 99 | 3D463F87223187A3000FB12F = { 100 | CreatedOnToolsVersion = 10.1; 101 | LastSwiftMigration = 1010; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = 3D463F82223187A3000FB12F /* Build configuration list for PBXProject "Utils" */; 106 | compatibilityVersion = "Xcode 9.3"; 107 | developmentRegion = en; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | ); 112 | mainGroup = 3D463F7E223187A3000FB12F; 113 | productRefGroup = 3D463F89223187A3000FB12F /* Products */; 114 | projectDirPath = ""; 115 | projectRoot = ""; 116 | targets = ( 117 | 3D463F87223187A3000FB12F /* Utils */, 118 | ); 119 | }; 120 | /* End PBXProject section */ 121 | 122 | /* Begin PBXResourcesBuildPhase section */ 123 | 3D463F86223187A3000FB12F /* Resources */ = { 124 | isa = PBXResourcesBuildPhase; 125 | buildActionMask = 2147483647; 126 | files = ( 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | /* End PBXResourcesBuildPhase section */ 131 | 132 | /* Begin PBXSourcesBuildPhase section */ 133 | 3D463F84223187A3000FB12F /* Sources */ = { 134 | isa = PBXSourcesBuildPhase; 135 | buildActionMask = 2147483647; 136 | files = ( 137 | 3D46401722318EEA000FB12F /* DependencyManager.swift in Sources */, 138 | ); 139 | runOnlyForDeploymentPostprocessing = 0; 140 | }; 141 | /* End PBXSourcesBuildPhase section */ 142 | 143 | /* Begin XCBuildConfiguration section */ 144 | 3D463F8E223187A3000FB12F /* Debug */ = { 145 | isa = XCBuildConfiguration; 146 | buildSettings = { 147 | ALWAYS_SEARCH_USER_PATHS = NO; 148 | CLANG_ANALYZER_NONNULL = YES; 149 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 150 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 151 | CLANG_CXX_LIBRARY = "libc++"; 152 | CLANG_ENABLE_MODULES = YES; 153 | CLANG_ENABLE_OBJC_ARC = YES; 154 | CLANG_ENABLE_OBJC_WEAK = YES; 155 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 156 | CLANG_WARN_BOOL_CONVERSION = YES; 157 | CLANG_WARN_COMMA = YES; 158 | CLANG_WARN_CONSTANT_CONVERSION = YES; 159 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 160 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 161 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 162 | CLANG_WARN_EMPTY_BODY = YES; 163 | CLANG_WARN_ENUM_CONVERSION = YES; 164 | CLANG_WARN_INFINITE_RECURSION = YES; 165 | CLANG_WARN_INT_CONVERSION = YES; 166 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 167 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 168 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 169 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 170 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 171 | CLANG_WARN_STRICT_PROTOTYPES = YES; 172 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 173 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 174 | CLANG_WARN_UNREACHABLE_CODE = YES; 175 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 176 | CODE_SIGN_IDENTITY = "iPhone Developer"; 177 | COPY_PHASE_STRIP = NO; 178 | CURRENT_PROJECT_VERSION = 1; 179 | DEBUG_INFORMATION_FORMAT = dwarf; 180 | ENABLE_STRICT_OBJC_MSGSEND = YES; 181 | ENABLE_TESTABILITY = YES; 182 | GCC_C_LANGUAGE_STANDARD = gnu11; 183 | GCC_DYNAMIC_NO_PIC = NO; 184 | GCC_NO_COMMON_BLOCKS = YES; 185 | GCC_OPTIMIZATION_LEVEL = 0; 186 | GCC_PREPROCESSOR_DEFINITIONS = ( 187 | "DEBUG=1", 188 | "$(inherited)", 189 | ); 190 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 191 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 192 | GCC_WARN_UNDECLARED_SELECTOR = YES; 193 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 194 | GCC_WARN_UNUSED_FUNCTION = YES; 195 | GCC_WARN_UNUSED_VARIABLE = YES; 196 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 197 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 198 | MTL_FAST_MATH = YES; 199 | ONLY_ACTIVE_ARCH = YES; 200 | SDKROOT = iphoneos; 201 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 202 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 203 | VERSIONING_SYSTEM = "apple-generic"; 204 | VERSION_INFO_PREFIX = ""; 205 | }; 206 | name = Debug; 207 | }; 208 | 3D463F8F223187A3000FB12F /* Release */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | ALWAYS_SEARCH_USER_PATHS = NO; 212 | CLANG_ANALYZER_NONNULL = YES; 213 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 214 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 215 | CLANG_CXX_LIBRARY = "libc++"; 216 | CLANG_ENABLE_MODULES = YES; 217 | CLANG_ENABLE_OBJC_ARC = YES; 218 | CLANG_ENABLE_OBJC_WEAK = YES; 219 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 220 | CLANG_WARN_BOOL_CONVERSION = YES; 221 | CLANG_WARN_COMMA = YES; 222 | CLANG_WARN_CONSTANT_CONVERSION = YES; 223 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 226 | CLANG_WARN_EMPTY_BODY = YES; 227 | CLANG_WARN_ENUM_CONVERSION = YES; 228 | CLANG_WARN_INFINITE_RECURSION = YES; 229 | CLANG_WARN_INT_CONVERSION = YES; 230 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 231 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 232 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 233 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 234 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 235 | CLANG_WARN_STRICT_PROTOTYPES = YES; 236 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 237 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 238 | CLANG_WARN_UNREACHABLE_CODE = YES; 239 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 240 | CODE_SIGN_IDENTITY = "iPhone Developer"; 241 | COPY_PHASE_STRIP = NO; 242 | CURRENT_PROJECT_VERSION = 1; 243 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 244 | ENABLE_NS_ASSERTIONS = NO; 245 | ENABLE_STRICT_OBJC_MSGSEND = YES; 246 | GCC_C_LANGUAGE_STANDARD = gnu11; 247 | GCC_NO_COMMON_BLOCKS = YES; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 250 | GCC_WARN_UNDECLARED_SELECTOR = YES; 251 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 252 | GCC_WARN_UNUSED_FUNCTION = YES; 253 | GCC_WARN_UNUSED_VARIABLE = YES; 254 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 255 | MTL_ENABLE_DEBUG_INFO = NO; 256 | MTL_FAST_MATH = YES; 257 | SDKROOT = iphoneos; 258 | SWIFT_COMPILATION_MODE = wholemodule; 259 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 260 | VALIDATE_PRODUCT = YES; 261 | VERSIONING_SYSTEM = "apple-generic"; 262 | VERSION_INFO_PREFIX = ""; 263 | }; 264 | name = Release; 265 | }; 266 | 3D463F91223187A3000FB12F /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | CLANG_ENABLE_MODULES = YES; 270 | CODE_SIGN_IDENTITY = ""; 271 | CODE_SIGN_STYLE = Automatic; 272 | DEFINES_MODULE = YES; 273 | DYLIB_COMPATIBILITY_VERSION = 1; 274 | DYLIB_CURRENT_VERSION = 1; 275 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 276 | INFOPLIST_FILE = Utils/Info.plist; 277 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 278 | LD_RUNPATH_SEARCH_PATHS = ( 279 | "$(inherited)", 280 | "@executable_path/Frameworks", 281 | "@loader_path/Frameworks", 282 | ); 283 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Utils; 284 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 285 | SKIP_INSTALL = YES; 286 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 287 | SWIFT_VERSION = 4.2; 288 | TARGETED_DEVICE_FAMILY = "1,2"; 289 | }; 290 | name = Debug; 291 | }; 292 | 3D463F92223187A3000FB12F /* Release */ = { 293 | isa = XCBuildConfiguration; 294 | buildSettings = { 295 | CLANG_ENABLE_MODULES = YES; 296 | CODE_SIGN_IDENTITY = ""; 297 | CODE_SIGN_STYLE = Automatic; 298 | DEFINES_MODULE = YES; 299 | DYLIB_COMPATIBILITY_VERSION = 1; 300 | DYLIB_CURRENT_VERSION = 1; 301 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 302 | INFOPLIST_FILE = Utils/Info.plist; 303 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 304 | LD_RUNPATH_SEARCH_PATHS = ( 305 | "$(inherited)", 306 | "@executable_path/Frameworks", 307 | "@loader_path/Frameworks", 308 | ); 309 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Utils; 310 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 311 | SKIP_INSTALL = YES; 312 | SWIFT_VERSION = 4.2; 313 | TARGETED_DEVICE_FAMILY = "1,2"; 314 | }; 315 | name = Release; 316 | }; 317 | /* End XCBuildConfiguration section */ 318 | 319 | /* Begin XCConfigurationList section */ 320 | 3D463F82223187A3000FB12F /* Build configuration list for PBXProject "Utils" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 3D463F8E223187A3000FB12F /* Debug */, 324 | 3D463F8F223187A3000FB12F /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | 3D463F90223187A3000FB12F /* Build configuration list for PBXNativeTarget "Utils" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | 3D463F91223187A3000FB12F /* Debug */, 333 | 3D463F92223187A3000FB12F /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | defaultConfigurationName = Release; 337 | }; 338 | /* End XCConfigurationList section */ 339 | }; 340 | rootObject = 3D463F7F223187A3000FB12F /* Project object */; 341 | } 342 | -------------------------------------------------------------------------------- /Common/Utils/Utils/DependencyManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DependencyManager.swift 3 | // Utils 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class DependencyManager { 12 | fileprivate var factories = [String: Any]() 13 | 14 | public init() { } 15 | 16 | fileprivate func key(_ type: T.Type) -> String { 17 | return String(reflecting: type) 18 | } 19 | 20 | public func register(_ type: T.Type, factory: @escaping () -> T?) { 21 | factories[key(type)] = factory 22 | } 23 | 24 | public func unregister(_ type: T.Type) { 25 | factories[key(type)] = nil 26 | } 27 | 28 | public func resolve(_ type: T.Type) -> T? { 29 | guard let factory = factories[key(type)] as? () -> T? else { 30 | return nil 31 | } 32 | return factory() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Common/Utils/Utils/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Common/Utils/Utils/Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.h 3 | // Utils 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Utils. 12 | FOUNDATION_EXPORT double UtilsVersionNumber; 13 | 14 | //! Project version string for Utils. 15 | FOUNDATION_EXPORT const unsigned char UtilsVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Modules/Chat/Chat.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D463FD8223189F0000FB12F /* Chat.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D463FD6223189F0000FB12F /* Chat.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 3D463FE0223189FF000FB12F /* Service.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D463FDF223189FF000FB12F /* Service.framework */; }; 12 | 3D463FE2223189FF000FB12F /* Utils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D463FE1223189FF000FB12F /* Utils.framework */; }; 13 | 3D46400E22318AD5000FB12F /* Dependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D46400D22318AD5000FB12F /* Dependencies.framework */; }; 14 | 3D464024223190D4000FB12F /* ChatModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D464023223190D4000FB12F /* ChatModule.swift */; }; 15 | 3D4640342231963E000FB12F /* MessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D4640332231963E000FB12F /* MessagesViewController.swift */; }; 16 | 3D464036223196E8000FB12F /* ConversationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D464035223196E8000FB12F /* ConversationsViewController.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 3D463FD3223189F0000FB12F /* Chat.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Chat.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 3D463FD6223189F0000FB12F /* Chat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Chat.h; sourceTree = ""; }; 22 | 3D463FD7223189F0000FB12F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | 3D463FDF223189FF000FB12F /* Service.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Service.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 3D463FE1223189FF000FB12F /* Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 3D46400D22318AD5000FB12F /* Dependencies.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Dependencies.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 3D464023223190D4000FB12F /* ChatModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatModule.swift; sourceTree = ""; }; 27 | 3D4640332231963E000FB12F /* MessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesViewController.swift; sourceTree = ""; }; 28 | 3D464035223196E8000FB12F /* ConversationsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversationsViewController.swift; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 3D463FD0223189F0000FB12F /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | 3D46400E22318AD5000FB12F /* Dependencies.framework in Frameworks */, 37 | 3D463FE0223189FF000FB12F /* Service.framework in Frameworks */, 38 | 3D463FE2223189FF000FB12F /* Utils.framework in Frameworks */, 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 3D463FC9223189EF000FB12F = { 46 | isa = PBXGroup; 47 | children = ( 48 | 3D463FD5223189F0000FB12F /* Chat */, 49 | 3D463FD4223189F0000FB12F /* Products */, 50 | 3D463FDE223189FF000FB12F /* Frameworks */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | 3D463FD4223189F0000FB12F /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 3D463FD3223189F0000FB12F /* Chat.framework */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | 3D463FD5223189F0000FB12F /* Chat */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 3D463FD6223189F0000FB12F /* Chat.h */, 66 | 3D464023223190D4000FB12F /* ChatModule.swift */, 67 | 3D464035223196E8000FB12F /* ConversationsViewController.swift */, 68 | 3D4640332231963E000FB12F /* MessagesViewController.swift */, 69 | 3D463FD7223189F0000FB12F /* Info.plist */, 70 | ); 71 | path = Chat; 72 | sourceTree = ""; 73 | }; 74 | 3D463FDE223189FF000FB12F /* Frameworks */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 3D46400D22318AD5000FB12F /* Dependencies.framework */, 78 | 3D463FDF223189FF000FB12F /* Service.framework */, 79 | 3D463FE1223189FF000FB12F /* Utils.framework */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | /* End PBXGroup section */ 85 | 86 | /* Begin PBXHeadersBuildPhase section */ 87 | 3D463FCE223189F0000FB12F /* Headers */ = { 88 | isa = PBXHeadersBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | 3D463FD8223189F0000FB12F /* Chat.h in Headers */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXHeadersBuildPhase section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | 3D463FD2223189F0000FB12F /* Chat */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = 3D463FDB223189F0000FB12F /* Build configuration list for PBXNativeTarget "Chat" */; 101 | buildPhases = ( 102 | 3D463FCE223189F0000FB12F /* Headers */, 103 | 3D463FCF223189F0000FB12F /* Sources */, 104 | 3D463FD0223189F0000FB12F /* Frameworks */, 105 | 3D463FD1223189F0000FB12F /* Resources */, 106 | ); 107 | buildRules = ( 108 | ); 109 | dependencies = ( 110 | ); 111 | name = Chat; 112 | productName = Chat; 113 | productReference = 3D463FD3223189F0000FB12F /* Chat.framework */; 114 | productType = "com.apple.product-type.framework"; 115 | }; 116 | /* End PBXNativeTarget section */ 117 | 118 | /* Begin PBXProject section */ 119 | 3D463FCA223189EF000FB12F /* Project object */ = { 120 | isa = PBXProject; 121 | attributes = { 122 | LastUpgradeCheck = 1010; 123 | ORGANIZATIONNAME = Depop; 124 | TargetAttributes = { 125 | 3D463FD2223189F0000FB12F = { 126 | CreatedOnToolsVersion = 10.1; 127 | LastSwiftMigration = 1010; 128 | }; 129 | }; 130 | }; 131 | buildConfigurationList = 3D463FCD223189EF000FB12F /* Build configuration list for PBXProject "Chat" */; 132 | compatibilityVersion = "Xcode 9.3"; 133 | developmentRegion = en; 134 | hasScannedForEncodings = 0; 135 | knownRegions = ( 136 | en, 137 | ); 138 | mainGroup = 3D463FC9223189EF000FB12F; 139 | productRefGroup = 3D463FD4223189F0000FB12F /* Products */; 140 | projectDirPath = ""; 141 | projectRoot = ""; 142 | targets = ( 143 | 3D463FD2223189F0000FB12F /* Chat */, 144 | ); 145 | }; 146 | /* End PBXProject section */ 147 | 148 | /* Begin PBXResourcesBuildPhase section */ 149 | 3D463FD1223189F0000FB12F /* Resources */ = { 150 | isa = PBXResourcesBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXResourcesBuildPhase section */ 157 | 158 | /* Begin PBXSourcesBuildPhase section */ 159 | 3D463FCF223189F0000FB12F /* Sources */ = { 160 | isa = PBXSourcesBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | 3D464036223196E8000FB12F /* ConversationsViewController.swift in Sources */, 164 | 3D4640342231963E000FB12F /* MessagesViewController.swift in Sources */, 165 | 3D464024223190D4000FB12F /* ChatModule.swift in Sources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXSourcesBuildPhase section */ 170 | 171 | /* Begin XCBuildConfiguration section */ 172 | 3D463FD9223189F0000FB12F /* Debug */ = { 173 | isa = XCBuildConfiguration; 174 | buildSettings = { 175 | ALWAYS_SEARCH_USER_PATHS = NO; 176 | CLANG_ANALYZER_NONNULL = YES; 177 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 178 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 179 | CLANG_CXX_LIBRARY = "libc++"; 180 | CLANG_ENABLE_MODULES = YES; 181 | CLANG_ENABLE_OBJC_ARC = YES; 182 | CLANG_ENABLE_OBJC_WEAK = YES; 183 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 184 | CLANG_WARN_BOOL_CONVERSION = YES; 185 | CLANG_WARN_COMMA = YES; 186 | CLANG_WARN_CONSTANT_CONVERSION = YES; 187 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 188 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 189 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 190 | CLANG_WARN_EMPTY_BODY = YES; 191 | CLANG_WARN_ENUM_CONVERSION = YES; 192 | CLANG_WARN_INFINITE_RECURSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 195 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 196 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 197 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 198 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 199 | CLANG_WARN_STRICT_PROTOTYPES = YES; 200 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 201 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 202 | CLANG_WARN_UNREACHABLE_CODE = YES; 203 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 204 | CODE_SIGN_IDENTITY = "iPhone Developer"; 205 | COPY_PHASE_STRIP = NO; 206 | CURRENT_PROJECT_VERSION = 1; 207 | DEBUG_INFORMATION_FORMAT = dwarf; 208 | ENABLE_STRICT_OBJC_MSGSEND = YES; 209 | ENABLE_TESTABILITY = YES; 210 | GCC_C_LANGUAGE_STANDARD = gnu11; 211 | GCC_DYNAMIC_NO_PIC = NO; 212 | GCC_NO_COMMON_BLOCKS = YES; 213 | GCC_OPTIMIZATION_LEVEL = 0; 214 | GCC_PREPROCESSOR_DEFINITIONS = ( 215 | "DEBUG=1", 216 | "$(inherited)", 217 | ); 218 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 219 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 220 | GCC_WARN_UNDECLARED_SELECTOR = YES; 221 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 222 | GCC_WARN_UNUSED_FUNCTION = YES; 223 | GCC_WARN_UNUSED_VARIABLE = YES; 224 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 225 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 226 | MTL_FAST_MATH = YES; 227 | ONLY_ACTIVE_ARCH = YES; 228 | SDKROOT = iphoneos; 229 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 230 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 231 | VERSIONING_SYSTEM = "apple-generic"; 232 | VERSION_INFO_PREFIX = ""; 233 | }; 234 | name = Debug; 235 | }; 236 | 3D463FDA223189F0000FB12F /* Release */ = { 237 | isa = XCBuildConfiguration; 238 | buildSettings = { 239 | ALWAYS_SEARCH_USER_PATHS = NO; 240 | CLANG_ANALYZER_NONNULL = YES; 241 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 242 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 243 | CLANG_CXX_LIBRARY = "libc++"; 244 | CLANG_ENABLE_MODULES = YES; 245 | CLANG_ENABLE_OBJC_ARC = YES; 246 | CLANG_ENABLE_OBJC_WEAK = YES; 247 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 248 | CLANG_WARN_BOOL_CONVERSION = YES; 249 | CLANG_WARN_COMMA = YES; 250 | CLANG_WARN_CONSTANT_CONVERSION = YES; 251 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 252 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 253 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 254 | CLANG_WARN_EMPTY_BODY = YES; 255 | CLANG_WARN_ENUM_CONVERSION = YES; 256 | CLANG_WARN_INFINITE_RECURSION = YES; 257 | CLANG_WARN_INT_CONVERSION = YES; 258 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 259 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 260 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 261 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 262 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 263 | CLANG_WARN_STRICT_PROTOTYPES = YES; 264 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 265 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 266 | CLANG_WARN_UNREACHABLE_CODE = YES; 267 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 268 | CODE_SIGN_IDENTITY = "iPhone Developer"; 269 | COPY_PHASE_STRIP = NO; 270 | CURRENT_PROJECT_VERSION = 1; 271 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 272 | ENABLE_NS_ASSERTIONS = NO; 273 | ENABLE_STRICT_OBJC_MSGSEND = YES; 274 | GCC_C_LANGUAGE_STANDARD = gnu11; 275 | GCC_NO_COMMON_BLOCKS = YES; 276 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 277 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 278 | GCC_WARN_UNDECLARED_SELECTOR = YES; 279 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 280 | GCC_WARN_UNUSED_FUNCTION = YES; 281 | GCC_WARN_UNUSED_VARIABLE = YES; 282 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 283 | MTL_ENABLE_DEBUG_INFO = NO; 284 | MTL_FAST_MATH = YES; 285 | SDKROOT = iphoneos; 286 | SWIFT_COMPILATION_MODE = wholemodule; 287 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 288 | VALIDATE_PRODUCT = YES; 289 | VERSIONING_SYSTEM = "apple-generic"; 290 | VERSION_INFO_PREFIX = ""; 291 | }; 292 | name = Release; 293 | }; 294 | 3D463FDC223189F0000FB12F /* Debug */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | CLANG_ENABLE_MODULES = YES; 298 | CODE_SIGN_IDENTITY = ""; 299 | CODE_SIGN_STYLE = Automatic; 300 | DEFINES_MODULE = YES; 301 | DYLIB_COMPATIBILITY_VERSION = 1; 302 | DYLIB_CURRENT_VERSION = 1; 303 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 304 | INFOPLIST_FILE = Chat/Info.plist; 305 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 306 | LD_RUNPATH_SEARCH_PATHS = ( 307 | "$(inherited)", 308 | "@executable_path/Frameworks", 309 | "@loader_path/Frameworks", 310 | ); 311 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Chat; 312 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 313 | SKIP_INSTALL = YES; 314 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 315 | SWIFT_VERSION = 4.2; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | }; 318 | name = Debug; 319 | }; 320 | 3D463FDD223189F0000FB12F /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | buildSettings = { 323 | CLANG_ENABLE_MODULES = YES; 324 | CODE_SIGN_IDENTITY = ""; 325 | CODE_SIGN_STYLE = Automatic; 326 | DEFINES_MODULE = YES; 327 | DYLIB_COMPATIBILITY_VERSION = 1; 328 | DYLIB_CURRENT_VERSION = 1; 329 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 330 | INFOPLIST_FILE = Chat/Info.plist; 331 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 332 | LD_RUNPATH_SEARCH_PATHS = ( 333 | "$(inherited)", 334 | "@executable_path/Frameworks", 335 | "@loader_path/Frameworks", 336 | ); 337 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.Chat; 338 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 339 | SKIP_INSTALL = YES; 340 | SWIFT_VERSION = 4.2; 341 | TARGETED_DEVICE_FAMILY = "1,2"; 342 | }; 343 | name = Release; 344 | }; 345 | /* End XCBuildConfiguration section */ 346 | 347 | /* Begin XCConfigurationList section */ 348 | 3D463FCD223189EF000FB12F /* Build configuration list for PBXProject "Chat" */ = { 349 | isa = XCConfigurationList; 350 | buildConfigurations = ( 351 | 3D463FD9223189F0000FB12F /* Debug */, 352 | 3D463FDA223189F0000FB12F /* Release */, 353 | ); 354 | defaultConfigurationIsVisible = 0; 355 | defaultConfigurationName = Release; 356 | }; 357 | 3D463FDB223189F0000FB12F /* Build configuration list for PBXNativeTarget "Chat" */ = { 358 | isa = XCConfigurationList; 359 | buildConfigurations = ( 360 | 3D463FDC223189F0000FB12F /* Debug */, 361 | 3D463FDD223189F0000FB12F /* Release */, 362 | ); 363 | defaultConfigurationIsVisible = 0; 364 | defaultConfigurationName = Release; 365 | }; 366 | /* End XCConfigurationList section */ 367 | }; 368 | rootObject = 3D463FCA223189EF000FB12F /* Project object */; 369 | } 370 | -------------------------------------------------------------------------------- /Modules/Chat/Chat/Chat.h: -------------------------------------------------------------------------------- 1 | // 2 | // Chat.h 3 | // Chat 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Chat. 12 | FOUNDATION_EXPORT double ChatVersionNumber; 13 | 14 | //! Project version string for Chat. 15 | FOUNDATION_EXPORT const unsigned char ChatVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Modules/Chat/Chat/ChatModule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChatModule.swift 3 | // Chat 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dependencies 11 | import Service 12 | 13 | public class ChatModule: ChatModuleProtocol { 14 | public init() {} 15 | 16 | public func messageSender(to receiver: User, about product: Product?) -> ChatMessageSender { 17 | // configure and return an object for sending a msg in the background 18 | return MessageSender() 19 | } 20 | 21 | public func conversationsScreen() -> UIViewController { 22 | // configure and return a view controller 23 | return ConversationsViewController() 24 | } 25 | 26 | public func messagesScreen(user: User, product: Product?) -> UIViewController { 27 | // configure and return a view controller 28 | return MessagesViewController(user: user, product: product) 29 | } 30 | } 31 | 32 | private class MessageSender: ChatMessageSender { 33 | 34 | func sendNewMessage(with body: String, completion: @escaping (String?) -> Void) { 35 | // provide an implementation here 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Modules/Chat/Chat/ConversationsViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConversationsViewController.swift 3 | // Chat 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Service 11 | 12 | class ConversationsViewController: UITableViewController { 13 | 14 | private var model: [ConversationModel] 15 | private var viewModel: [ConversationViewModel] 16 | 17 | init() { 18 | model = createModel() 19 | viewModel = createViewModel(model: model) 20 | super.init(style: .plain) 21 | } 22 | 23 | required init?(coder aDecoder: NSCoder) { 24 | fatalError("init(coder:) has not been implemented") 25 | } 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | 30 | // Do any additional setup after loading the view. 31 | navigationItem.title = "Your conversations" 32 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "default") 33 | } 34 | 35 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 36 | return viewModel.count 37 | } 38 | 39 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 40 | let item = viewModel[indexPath.row] 41 | 42 | let cell = tableView.dequeueReusableCell(withIdentifier: "default", for: indexPath) 43 | cell.textLabel?.text = item.title 44 | 45 | return cell 46 | } 47 | 48 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 49 | let item = model[indexPath.row] 50 | openChat(user: item.user, product: item.product) 51 | } 52 | 53 | func openChat(user: User, product: Product?) { 54 | let screen = MessagesViewController(user: user, product: product) 55 | navigationController?.pushViewController(screen, animated: true) 56 | } 57 | } 58 | 59 | private struct ConversationModel { 60 | let user: User 61 | let product: Product? 62 | } 63 | 64 | private struct ConversationViewModel { 65 | let title: String 66 | } 67 | 68 | private func createModel() -> [ConversationModel] { 69 | return [ 70 | ConversationModel(user: User(identifier: "u1"), product: Product(identifier: "p1")), 71 | ConversationModel(user: User(identifier: "u2"), product: nil), 72 | ConversationModel(user: User(identifier: "u3"), product: nil), 73 | ] 74 | } 75 | 76 | private func createViewModel(model: [ConversationModel]) -> [ConversationViewModel] { 77 | return model.map({ item in 78 | let debugDescription = "\(item.user) - \((item.product?.debugDescription ?? "no product"))" 79 | return ConversationViewModel(title: debugDescription) 80 | }) 81 | } 82 | -------------------------------------------------------------------------------- /Modules/Chat/Chat/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Modules/Chat/Chat/MessagesViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessagesViewController.swift 3 | // Chat 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Service 11 | import Dependencies 12 | 13 | class MessagesViewController: UIViewController { 14 | 15 | let user: User 16 | let product: Product? 17 | 18 | init(user: User, product: Product?) { 19 | self.user = user 20 | self.product = product 21 | super.init(nibName: nil, bundle: nil) 22 | } 23 | 24 | required init?(coder aDecoder: NSCoder) { 25 | fatalError("init(coder:) has not been implemented") 26 | } 27 | 28 | override func viewDidLoad() { 29 | super.viewDidLoad() 30 | 31 | // Do any additional setup after loading the view. 32 | navigationItem.title = "Chat" 33 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Profile", style: .plain, target: self, action: #selector(openUserProfile)) 34 | view.backgroundColor = UIColor.red 35 | showLabel() 36 | } 37 | 38 | private func showLabel() { 39 | // add a label with user and product data 40 | let label = UILabel(frame: CGRect.zero) 41 | label.translatesAutoresizingMaskIntoConstraints = false 42 | label.numberOfLines = 0 43 | label.font = UIFont.systemFont(ofSize: 30) 44 | label.text = "\(user)\n\((product?.debugDescription ?? "no product"))" 45 | let constraints = [ 46 | label.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10), 47 | label.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 10), 48 | label.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: 10) 49 | ] 50 | view.addSubview(label) 51 | NSLayoutConstraint.activate(constraints) 52 | } 53 | 54 | @objc func openUserProfile() { 55 | let module = Dependencies.shared.userProfileModule 56 | let screen = module.userProfileScreen(user: user) 57 | navigationController?.pushViewController(screen, animated: true) 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Modules/UserProfile/UserProfile.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D463FF222318A30000FB12F /* UserProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D463FF022318A30000FB12F /* UserProfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 3D46401122318ADC000FB12F /* Dependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D46401022318ADC000FB12F /* Dependencies.framework */; }; 12 | 3D46401322318AE1000FB12F /* Service.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D46401222318AE1000FB12F /* Service.framework */; }; 13 | 3D46401522318AE1000FB12F /* Utils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D46401422318AE1000FB12F /* Utils.framework */; }; 14 | 3D4640282231937F000FB12F /* UserProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D4640272231937F000FB12F /* UserProfileViewController.swift */; }; 15 | 3D46402C223194B3000FB12F /* UserProfileModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D46402B223194B3000FB12F /* UserProfileModule.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 3D463FED22318A30000FB12F /* UserProfile.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = UserProfile.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 3D463FF022318A30000FB12F /* UserProfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserProfile.h; sourceTree = ""; }; 21 | 3D463FF122318A30000FB12F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 22 | 3D46401022318ADC000FB12F /* Dependencies.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Dependencies.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 3D46401222318AE1000FB12F /* Service.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Service.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 3D46401422318AE1000FB12F /* Utils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Utils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 3D4640272231937F000FB12F /* UserProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileViewController.swift; sourceTree = ""; }; 26 | 3D46402B223194B3000FB12F /* UserProfileModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileModule.swift; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 3D463FEA22318A30000FB12F /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | 3D46401322318AE1000FB12F /* Service.framework in Frameworks */, 35 | 3D46401522318AE1000FB12F /* Utils.framework in Frameworks */, 36 | 3D46401122318ADC000FB12F /* Dependencies.framework in Frameworks */, 37 | ); 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXFrameworksBuildPhase section */ 41 | 42 | /* Begin PBXGroup section */ 43 | 3D463FE322318A30000FB12F = { 44 | isa = PBXGroup; 45 | children = ( 46 | 3D463FEF22318A30000FB12F /* UserProfile */, 47 | 3D463FEE22318A30000FB12F /* Products */, 48 | 3D46400F22318ADC000FB12F /* Frameworks */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | 3D463FEE22318A30000FB12F /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 3D463FED22318A30000FB12F /* UserProfile.framework */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | 3D463FEF22318A30000FB12F /* UserProfile */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 3D463FF022318A30000FB12F /* UserProfile.h */, 64 | 3D46402B223194B3000FB12F /* UserProfileModule.swift */, 65 | 3D4640272231937F000FB12F /* UserProfileViewController.swift */, 66 | 3D463FF122318A30000FB12F /* Info.plist */, 67 | ); 68 | path = UserProfile; 69 | sourceTree = ""; 70 | }; 71 | 3D46400F22318ADC000FB12F /* Frameworks */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3D46401222318AE1000FB12F /* Service.framework */, 75 | 3D46401422318AE1000FB12F /* Utils.framework */, 76 | 3D46401022318ADC000FB12F /* Dependencies.framework */, 77 | ); 78 | name = Frameworks; 79 | sourceTree = ""; 80 | }; 81 | /* End PBXGroup section */ 82 | 83 | /* Begin PBXHeadersBuildPhase section */ 84 | 3D463FE822318A30000FB12F /* Headers */ = { 85 | isa = PBXHeadersBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 3D463FF222318A30000FB12F /* UserProfile.h in Headers */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | /* End PBXHeadersBuildPhase section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | 3D463FEC22318A30000FB12F /* UserProfile */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = 3D463FF522318A30000FB12F /* Build configuration list for PBXNativeTarget "UserProfile" */; 98 | buildPhases = ( 99 | 3D463FE822318A30000FB12F /* Headers */, 100 | 3D463FE922318A30000FB12F /* Sources */, 101 | 3D463FEA22318A30000FB12F /* Frameworks */, 102 | 3D463FEB22318A30000FB12F /* Resources */, 103 | ); 104 | buildRules = ( 105 | ); 106 | dependencies = ( 107 | ); 108 | name = UserProfile; 109 | productName = UserProfile; 110 | productReference = 3D463FED22318A30000FB12F /* UserProfile.framework */; 111 | productType = "com.apple.product-type.framework"; 112 | }; 113 | /* End PBXNativeTarget section */ 114 | 115 | /* Begin PBXProject section */ 116 | 3D463FE422318A30000FB12F /* Project object */ = { 117 | isa = PBXProject; 118 | attributes = { 119 | LastUpgradeCheck = 1010; 120 | ORGANIZATIONNAME = Depop; 121 | TargetAttributes = { 122 | 3D463FEC22318A30000FB12F = { 123 | CreatedOnToolsVersion = 10.1; 124 | LastSwiftMigration = 1010; 125 | }; 126 | }; 127 | }; 128 | buildConfigurationList = 3D463FE722318A30000FB12F /* Build configuration list for PBXProject "UserProfile" */; 129 | compatibilityVersion = "Xcode 9.3"; 130 | developmentRegion = en; 131 | hasScannedForEncodings = 0; 132 | knownRegions = ( 133 | en, 134 | ); 135 | mainGroup = 3D463FE322318A30000FB12F; 136 | productRefGroup = 3D463FEE22318A30000FB12F /* Products */; 137 | projectDirPath = ""; 138 | projectRoot = ""; 139 | targets = ( 140 | 3D463FEC22318A30000FB12F /* UserProfile */, 141 | ); 142 | }; 143 | /* End PBXProject section */ 144 | 145 | /* Begin PBXResourcesBuildPhase section */ 146 | 3D463FEB22318A30000FB12F /* Resources */ = { 147 | isa = PBXResourcesBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | /* End PBXResourcesBuildPhase section */ 154 | 155 | /* Begin PBXSourcesBuildPhase section */ 156 | 3D463FE922318A30000FB12F /* Sources */ = { 157 | isa = PBXSourcesBuildPhase; 158 | buildActionMask = 2147483647; 159 | files = ( 160 | 3D46402C223194B3000FB12F /* UserProfileModule.swift in Sources */, 161 | 3D4640282231937F000FB12F /* UserProfileViewController.swift in Sources */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXSourcesBuildPhase section */ 166 | 167 | /* Begin XCBuildConfiguration section */ 168 | 3D463FF322318A30000FB12F /* Debug */ = { 169 | isa = XCBuildConfiguration; 170 | buildSettings = { 171 | ALWAYS_SEARCH_USER_PATHS = NO; 172 | CLANG_ANALYZER_NONNULL = YES; 173 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 174 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 175 | CLANG_CXX_LIBRARY = "libc++"; 176 | CLANG_ENABLE_MODULES = YES; 177 | CLANG_ENABLE_OBJC_ARC = YES; 178 | CLANG_ENABLE_OBJC_WEAK = YES; 179 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 180 | CLANG_WARN_BOOL_CONVERSION = YES; 181 | CLANG_WARN_COMMA = YES; 182 | CLANG_WARN_CONSTANT_CONVERSION = YES; 183 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 185 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 186 | CLANG_WARN_EMPTY_BODY = YES; 187 | CLANG_WARN_ENUM_CONVERSION = YES; 188 | CLANG_WARN_INFINITE_RECURSION = YES; 189 | CLANG_WARN_INT_CONVERSION = YES; 190 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 191 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 192 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 193 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 194 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 195 | CLANG_WARN_STRICT_PROTOTYPES = YES; 196 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 197 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 198 | CLANG_WARN_UNREACHABLE_CODE = YES; 199 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 200 | CODE_SIGN_IDENTITY = "iPhone Developer"; 201 | COPY_PHASE_STRIP = NO; 202 | CURRENT_PROJECT_VERSION = 1; 203 | DEBUG_INFORMATION_FORMAT = dwarf; 204 | ENABLE_STRICT_OBJC_MSGSEND = YES; 205 | ENABLE_TESTABILITY = YES; 206 | GCC_C_LANGUAGE_STANDARD = gnu11; 207 | GCC_DYNAMIC_NO_PIC = NO; 208 | GCC_NO_COMMON_BLOCKS = YES; 209 | GCC_OPTIMIZATION_LEVEL = 0; 210 | GCC_PREPROCESSOR_DEFINITIONS = ( 211 | "DEBUG=1", 212 | "$(inherited)", 213 | ); 214 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 215 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 216 | GCC_WARN_UNDECLARED_SELECTOR = YES; 217 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 218 | GCC_WARN_UNUSED_FUNCTION = YES; 219 | GCC_WARN_UNUSED_VARIABLE = YES; 220 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 221 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 222 | MTL_FAST_MATH = YES; 223 | ONLY_ACTIVE_ARCH = YES; 224 | SDKROOT = iphoneos; 225 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 226 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 227 | VERSIONING_SYSTEM = "apple-generic"; 228 | VERSION_INFO_PREFIX = ""; 229 | }; 230 | name = Debug; 231 | }; 232 | 3D463FF422318A30000FB12F /* Release */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ALWAYS_SEARCH_USER_PATHS = NO; 236 | CLANG_ANALYZER_NONNULL = YES; 237 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 238 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 239 | CLANG_CXX_LIBRARY = "libc++"; 240 | CLANG_ENABLE_MODULES = YES; 241 | CLANG_ENABLE_OBJC_ARC = YES; 242 | CLANG_ENABLE_OBJC_WEAK = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 250 | CLANG_WARN_EMPTY_BODY = YES; 251 | CLANG_WARN_ENUM_CONVERSION = YES; 252 | CLANG_WARN_INFINITE_RECURSION = YES; 253 | CLANG_WARN_INT_CONVERSION = YES; 254 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 255 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 256 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 257 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 258 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 259 | CLANG_WARN_STRICT_PROTOTYPES = YES; 260 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 261 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | CODE_SIGN_IDENTITY = "iPhone Developer"; 265 | COPY_PHASE_STRIP = NO; 266 | CURRENT_PROJECT_VERSION = 1; 267 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 268 | ENABLE_NS_ASSERTIONS = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | GCC_C_LANGUAGE_STANDARD = gnu11; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 274 | GCC_WARN_UNDECLARED_SELECTOR = YES; 275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 276 | GCC_WARN_UNUSED_FUNCTION = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 279 | MTL_ENABLE_DEBUG_INFO = NO; 280 | MTL_FAST_MATH = YES; 281 | SDKROOT = iphoneos; 282 | SWIFT_COMPILATION_MODE = wholemodule; 283 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 284 | VALIDATE_PRODUCT = YES; 285 | VERSIONING_SYSTEM = "apple-generic"; 286 | VERSION_INFO_PREFIX = ""; 287 | }; 288 | name = Release; 289 | }; 290 | 3D463FF622318A30000FB12F /* Debug */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | CLANG_ENABLE_MODULES = YES; 294 | CODE_SIGN_IDENTITY = ""; 295 | CODE_SIGN_STYLE = Automatic; 296 | DEFINES_MODULE = YES; 297 | DYLIB_COMPATIBILITY_VERSION = 1; 298 | DYLIB_CURRENT_VERSION = 1; 299 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 300 | INFOPLIST_FILE = UserProfile/Info.plist; 301 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 302 | LD_RUNPATH_SEARCH_PATHS = ( 303 | "$(inherited)", 304 | "@executable_path/Frameworks", 305 | "@loader_path/Frameworks", 306 | ); 307 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.UserProfile; 308 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 309 | SKIP_INSTALL = YES; 310 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 311 | SWIFT_VERSION = 4.2; 312 | TARGETED_DEVICE_FAMILY = "1,2"; 313 | }; 314 | name = Debug; 315 | }; 316 | 3D463FF722318A30000FB12F /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | CLANG_ENABLE_MODULES = YES; 320 | CODE_SIGN_IDENTITY = ""; 321 | CODE_SIGN_STYLE = Automatic; 322 | DEFINES_MODULE = YES; 323 | DYLIB_COMPATIBILITY_VERSION = 1; 324 | DYLIB_CURRENT_VERSION = 1; 325 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 326 | INFOPLIST_FILE = UserProfile/Info.plist; 327 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 328 | LD_RUNPATH_SEARCH_PATHS = ( 329 | "$(inherited)", 330 | "@executable_path/Frameworks", 331 | "@loader_path/Frameworks", 332 | ); 333 | PRODUCT_BUNDLE_IDENTIFIER = com.depop.UserProfile; 334 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 335 | SKIP_INSTALL = YES; 336 | SWIFT_VERSION = 4.2; 337 | TARGETED_DEVICE_FAMILY = "1,2"; 338 | }; 339 | name = Release; 340 | }; 341 | /* End XCBuildConfiguration section */ 342 | 343 | /* Begin XCConfigurationList section */ 344 | 3D463FE722318A30000FB12F /* Build configuration list for PBXProject "UserProfile" */ = { 345 | isa = XCConfigurationList; 346 | buildConfigurations = ( 347 | 3D463FF322318A30000FB12F /* Debug */, 348 | 3D463FF422318A30000FB12F /* Release */, 349 | ); 350 | defaultConfigurationIsVisible = 0; 351 | defaultConfigurationName = Release; 352 | }; 353 | 3D463FF522318A30000FB12F /* Build configuration list for PBXNativeTarget "UserProfile" */ = { 354 | isa = XCConfigurationList; 355 | buildConfigurations = ( 356 | 3D463FF622318A30000FB12F /* Debug */, 357 | 3D463FF722318A30000FB12F /* Release */, 358 | ); 359 | defaultConfigurationIsVisible = 0; 360 | defaultConfigurationName = Release; 361 | }; 362 | /* End XCConfigurationList section */ 363 | }; 364 | rootObject = 3D463FE422318A30000FB12F /* Project object */; 365 | } 366 | -------------------------------------------------------------------------------- /Modules/UserProfile/UserProfile/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Modules/UserProfile/UserProfile/UserProfile.h: -------------------------------------------------------------------------------- 1 | // 2 | // UserProfile.h 3 | // UserProfile 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for UserProfile. 12 | FOUNDATION_EXPORT double UserProfileVersionNumber; 13 | 14 | //! Project version string for UserProfile. 15 | FOUNDATION_EXPORT const unsigned char UserProfileVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Modules/UserProfile/UserProfile/UserProfileModule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserProfileModule.swift 3 | // UserProfile 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dependencies 11 | import Service 12 | 13 | public class UserProfileModule: UserProfileModuleProtocol { 14 | 15 | public init() {} 16 | 17 | public func userProfileScreen(user: User) -> UIViewController { 18 | return UserProfileViewController(user: user) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/UserProfile/UserProfile/UserProfileViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserProfileViewController.swift 3 | // UserProfile 4 | // 5 | // Created by Nebil Kriedi on 07/03/2019. 6 | // Copyright © 2019 Depop. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dependencies 11 | import Service 12 | 13 | class UserProfileViewController: UIViewController { 14 | 15 | let user: User 16 | init(user: User) { 17 | self.user = user 18 | super.init(nibName: nil, bundle: nil) 19 | } 20 | 21 | required init?(coder aDecoder: NSCoder) { 22 | fatalError("init(coder:) has not been implemented") 23 | } 24 | 25 | override func viewDidLoad() { 26 | super.viewDidLoad() 27 | 28 | // Do any additional setup after loading the view. 29 | view.backgroundColor = UIColor.blue 30 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Chat", style: .plain, target: self, action: #selector(openChat)) 31 | showLabel() 32 | } 33 | 34 | private func showLabel() { 35 | // add a label with user data 36 | let label = UILabel(frame: CGRect.zero) 37 | label.translatesAutoresizingMaskIntoConstraints = false 38 | label.numberOfLines = 0 39 | label.textColor = UIColor.yellow 40 | label.text = user.debugDescription 41 | label.font = UIFont.systemFont(ofSize: 30) 42 | let constraints = [ 43 | label.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10), 44 | label.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 10), 45 | label.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: 10) 46 | ] 47 | view.addSubview(label) 48 | NSLayoutConstraint.activate(constraints) 49 | } 50 | 51 | @objc func openChat() { 52 | let module = Dependencies.shared.chatModule 53 | let chatScreen = module.messagesScreen(user: user, product: nil) 54 | 55 | navigationController?.pushViewController(chatScreen, animated: true) 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /MyFirstModule.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 10 | 12 | 13 | 15 | 16 | 17 | 20 | 22 | 23 | 25 | 26 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MyFirstModule.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sample Project 2 | This project is a companion to our blog post about app modularisation: [read blog post](https://engineering.depop.com/scaling-up-an-ios-app-with-modularisation-8cd280d6b2b8) 3 | 4 | If you want more information on the structure of this project please check the link first. 5 | 6 | To explore the project just open **MyFirstModule.xcworkspace**. 7 | 8 | ## What's inside 9 | The workspace has several sub projects: 10 | 11 | **App** contains the main app bundle. 12 | **Modules** contains two distinct sets of feature: _Chat_ and _UserProfile_. 13 | **Service** and Utils contain things shared by all the features. 14 | **Dependendencies** is where you'll find the public protocol for all modules. 15 | 16 | ## What can you do 17 | This can be a base for a new project where you want to provide a basic support for modularisation. If you don't think your project will need this complexity then start simple and adopt something similar later. 18 | 19 | Try to add navigate to move the logic to return the _currentUser_ from the _AppDelegate_ inside the _UserProfile_ module. 20 | What if you want to acccess this information from within the _Chat_ module? 21 | 22 | Get in touch! Any feedback or comment is welcome. 23 | Just open a new _issue_ from the repo page. 24 | 25 | 26 | Thank you! 27 | _Depop iOS Team_ --------------------------------------------------------------------------------