├── Coordinators.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── zafar.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist └── Coordinators ├── App ├── AppCoordinator.swift └── AppDelegate.swift ├── Base └── Coordinator.swift ├── Presentation ├── History Detail │ ├── HistoryDetailCoordinator.swift │ └── HistoryDetailViewController.swift ├── History │ ├── HistoryCoordinator.swift │ ├── HistoryItem.swift │ └── HistoryViewController.swift ├── Search Detail │ ├── SearchDetailCoordinator.swift │ └── SearchDetailViewController.swift ├── Search │ ├── SearchCoordinator.swift │ └── SearchViewController.swift ├── Start │ ├── StartCoordinator.swift │ └── StartViewController.swift ├── Tab Bar │ ├── TabBarController.swift │ └── TabBarCoordinator.swift ├── Top Rated Detail │ ├── TopRatedDetailCoordinator.swift │ └── TopRatedDetailViewController.swift └── Top Rated │ ├── TopRatedCoordinator.swift │ └── TopRatedViewController.swift └── Supporting Files ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Base.lproj └── LaunchScreen.storyboard └── Info.plist /Coordinators.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1C1DFCD7241E643000612927 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C1DFCD6241E643000612927 /* AppDelegate.swift */; }; 11 | 1C1DFCE0241E643100612927 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1C1DFCDF241E643100612927 /* Assets.xcassets */; }; 12 | 1C1DFCE3241E643100612927 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1C1DFCE1241E643100612927 /* LaunchScreen.storyboard */; }; 13 | 1C776541241E96C400E70457 /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C776540241E96C400E70457 /* Coordinator.swift */; }; 14 | 1C776544241E989200E70457 /* AppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C776543241E989200E70457 /* AppCoordinator.swift */; }; 15 | 1C776548241EBB3700E70457 /* TabBarCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C776547241EBB3700E70457 /* TabBarCoordinator.swift */; }; 16 | 1CD79639241EBE9500A2DC72 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD79638241EBE9500A2DC72 /* HistoryViewController.swift */; }; 17 | 1CD7963B241EBEA200A2DC72 /* HistoryCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7963A241EBEA200A2DC72 /* HistoryCoordinator.swift */; }; 18 | 1CD7963D241EBEAB00A2DC72 /* SearchCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7963C241EBEAB00A2DC72 /* SearchCoordinator.swift */; }; 19 | 1CD7963F241EBEB200A2DC72 /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7963E241EBEB200A2DC72 /* SearchViewController.swift */; }; 20 | 1CD79641241EBEE300A2DC72 /* TopRatedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD79640241EBEE300A2DC72 /* TopRatedViewController.swift */; }; 21 | 1CD79643241EBEEA00A2DC72 /* TopRatedCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD79642241EBEEA00A2DC72 /* TopRatedCoordinator.swift */; }; 22 | 1CD79646241F414800A2DC72 /* TopRatedDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD79645241F414800A2DC72 /* TopRatedDetailViewController.swift */; }; 23 | 1CD79648241F415100A2DC72 /* TopRatedDetailCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD79647241F415100A2DC72 /* TopRatedDetailCoordinator.swift */; }; 24 | 1CD7964C241F471400A2DC72 /* HistoryDetailCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7964B241F471400A2DC72 /* HistoryDetailCoordinator.swift */; }; 25 | 1CD7964E241F471C00A2DC72 /* HistoryDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7964D241F471C00A2DC72 /* HistoryDetailViewController.swift */; }; 26 | 1CD79650241F472700A2DC72 /* SearchDetailCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7964F241F472700A2DC72 /* SearchDetailCoordinator.swift */; }; 27 | 1CD79652241F472F00A2DC72 /* SearchDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD79651241F472F00A2DC72 /* SearchDetailViewController.swift */; }; 28 | 1CD79654241F87A600A2DC72 /* HistoryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD79653241F87A600A2DC72 /* HistoryItem.swift */; }; 29 | 1CE513A5241E64C5008FAE23 /* StartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CE513A4241E64C5008FAE23 /* StartViewController.swift */; }; 30 | 1CE513A7241E64D0008FAE23 /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CE513A6241E64D0008FAE23 /* TabBarController.swift */; }; 31 | 1CE513AB241E6560008FAE23 /* StartCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CE513AA241E6560008FAE23 /* StartCoordinator.swift */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 1C1DFCD3241E643000612927 /* Coordinators.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Coordinators.app; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 1C1DFCD6241E643000612927 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 1C1DFCDF241E643100612927 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 38 | 1C1DFCE2241E643100612927 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 39 | 1C1DFCE4241E643100612927 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | 1C776540241E96C400E70457 /* Coordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coordinator.swift; sourceTree = ""; }; 41 | 1C776543241E989200E70457 /* AppCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCoordinator.swift; sourceTree = ""; }; 42 | 1C776547241EBB3700E70457 /* TabBarCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarCoordinator.swift; sourceTree = ""; }; 43 | 1CD79638241EBE9500A2DC72 /* HistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = ""; }; 44 | 1CD7963A241EBEA200A2DC72 /* HistoryCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryCoordinator.swift; sourceTree = ""; }; 45 | 1CD7963C241EBEAB00A2DC72 /* SearchCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchCoordinator.swift; sourceTree = ""; }; 46 | 1CD7963E241EBEB200A2DC72 /* SearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewController.swift; sourceTree = ""; }; 47 | 1CD79640241EBEE300A2DC72 /* TopRatedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopRatedViewController.swift; sourceTree = ""; }; 48 | 1CD79642241EBEEA00A2DC72 /* TopRatedCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopRatedCoordinator.swift; sourceTree = ""; }; 49 | 1CD79645241F414800A2DC72 /* TopRatedDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopRatedDetailViewController.swift; sourceTree = ""; }; 50 | 1CD79647241F415100A2DC72 /* TopRatedDetailCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopRatedDetailCoordinator.swift; sourceTree = ""; }; 51 | 1CD7964B241F471400A2DC72 /* HistoryDetailCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryDetailCoordinator.swift; sourceTree = ""; }; 52 | 1CD7964D241F471C00A2DC72 /* HistoryDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryDetailViewController.swift; sourceTree = ""; }; 53 | 1CD7964F241F472700A2DC72 /* SearchDetailCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchDetailCoordinator.swift; sourceTree = ""; }; 54 | 1CD79651241F472F00A2DC72 /* SearchDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchDetailViewController.swift; sourceTree = ""; }; 55 | 1CD79653241F87A600A2DC72 /* HistoryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryItem.swift; sourceTree = ""; }; 56 | 1CE513A4241E64C5008FAE23 /* StartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartViewController.swift; sourceTree = ""; }; 57 | 1CE513A6241E64D0008FAE23 /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = ""; }; 58 | 1CE513AA241E6560008FAE23 /* StartCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartCoordinator.swift; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 1C1DFCD0241E643000612927 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 1C1DFCCA241E642F00612927 = { 73 | isa = PBXGroup; 74 | children = ( 75 | 1C1DFCD5241E643000612927 /* Coordinators */, 76 | 1C1DFCD4241E643000612927 /* Products */, 77 | ); 78 | sourceTree = ""; 79 | }; 80 | 1C1DFCD4241E643000612927 /* Products */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 1C1DFCD3241E643000612927 /* Coordinators.app */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | 1C1DFCD5241E643000612927 /* Coordinators */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 1C776542241E96C900E70457 /* App */, 92 | 1C77653F241E96BD00E70457 /* Base */, 93 | 1C77654C241EBE4B00E70457 /* Presentation */, 94 | 1C1DFCEA241E646400612927 /* Supporting Files */, 95 | ); 96 | path = Coordinators; 97 | sourceTree = ""; 98 | }; 99 | 1C1DFCEA241E646400612927 /* Supporting Files */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 1C1DFCDF241E643100612927 /* Assets.xcassets */, 103 | 1C1DFCE1241E643100612927 /* LaunchScreen.storyboard */, 104 | 1C1DFCE4241E643100612927 /* Info.plist */, 105 | ); 106 | path = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | 1C77653F241E96BD00E70457 /* Base */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 1C776540241E96C400E70457 /* Coordinator.swift */, 113 | ); 114 | path = Base; 115 | sourceTree = ""; 116 | }; 117 | 1C776542241E96C900E70457 /* App */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 1C1DFCD6241E643000612927 /* AppDelegate.swift */, 121 | 1C776543241E989200E70457 /* AppCoordinator.swift */, 122 | ); 123 | path = App; 124 | sourceTree = ""; 125 | }; 126 | 1C776545241EB46100E70457 /* Start */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 1CE513AA241E6560008FAE23 /* StartCoordinator.swift */, 130 | 1CE513A4241E64C5008FAE23 /* StartViewController.swift */, 131 | ); 132 | path = Start; 133 | sourceTree = ""; 134 | }; 135 | 1C776546241EBAEF00E70457 /* Tab Bar */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 1C776547241EBB3700E70457 /* TabBarCoordinator.swift */, 139 | 1CE513A6241E64D0008FAE23 /* TabBarController.swift */, 140 | ); 141 | path = "Tab Bar"; 142 | sourceTree = ""; 143 | }; 144 | 1C776549241EBE0800E70457 /* Top Rated */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 1CD79642241EBEEA00A2DC72 /* TopRatedCoordinator.swift */, 148 | 1CD79640241EBEE300A2DC72 /* TopRatedViewController.swift */, 149 | ); 150 | path = "Top Rated"; 151 | sourceTree = ""; 152 | }; 153 | 1C77654A241EBE0C00E70457 /* Search */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 1CD7963C241EBEAB00A2DC72 /* SearchCoordinator.swift */, 157 | 1CD7963E241EBEB200A2DC72 /* SearchViewController.swift */, 158 | ); 159 | path = Search; 160 | sourceTree = ""; 161 | }; 162 | 1C77654B241EBE1800E70457 /* History */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 1CD7963A241EBEA200A2DC72 /* HistoryCoordinator.swift */, 166 | 1CD79638241EBE9500A2DC72 /* HistoryViewController.swift */, 167 | 1CD79653241F87A600A2DC72 /* HistoryItem.swift */, 168 | ); 169 | path = History; 170 | sourceTree = ""; 171 | }; 172 | 1C77654C241EBE4B00E70457 /* Presentation */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 1C776545241EB46100E70457 /* Start */, 176 | 1C776546241EBAEF00E70457 /* Tab Bar */, 177 | 1C776549241EBE0800E70457 /* Top Rated */, 178 | 1CD79644241F413200A2DC72 /* Top Rated Detail */, 179 | 1C77654A241EBE0C00E70457 /* Search */, 180 | 1CD79649241F435100A2DC72 /* Search Detail */, 181 | 1C77654B241EBE1800E70457 /* History */, 182 | 1CD7964A241F435B00A2DC72 /* History Detail */, 183 | ); 184 | path = Presentation; 185 | sourceTree = ""; 186 | }; 187 | 1CD79644241F413200A2DC72 /* Top Rated Detail */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 1CD79647241F415100A2DC72 /* TopRatedDetailCoordinator.swift */, 191 | 1CD79645241F414800A2DC72 /* TopRatedDetailViewController.swift */, 192 | ); 193 | path = "Top Rated Detail"; 194 | sourceTree = ""; 195 | }; 196 | 1CD79649241F435100A2DC72 /* Search Detail */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | 1CD7964F241F472700A2DC72 /* SearchDetailCoordinator.swift */, 200 | 1CD79651241F472F00A2DC72 /* SearchDetailViewController.swift */, 201 | ); 202 | path = "Search Detail"; 203 | sourceTree = ""; 204 | }; 205 | 1CD7964A241F435B00A2DC72 /* History Detail */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | 1CD7964B241F471400A2DC72 /* HistoryDetailCoordinator.swift */, 209 | 1CD7964D241F471C00A2DC72 /* HistoryDetailViewController.swift */, 210 | ); 211 | path = "History Detail"; 212 | sourceTree = ""; 213 | }; 214 | /* End PBXGroup section */ 215 | 216 | /* Begin PBXNativeTarget section */ 217 | 1C1DFCD2241E643000612927 /* Coordinators */ = { 218 | isa = PBXNativeTarget; 219 | buildConfigurationList = 1C1DFCE7241E643100612927 /* Build configuration list for PBXNativeTarget "Coordinators" */; 220 | buildPhases = ( 221 | 1C1DFCCF241E643000612927 /* Sources */, 222 | 1C1DFCD0241E643000612927 /* Frameworks */, 223 | 1C1DFCD1241E643000612927 /* Resources */, 224 | ); 225 | buildRules = ( 226 | ); 227 | dependencies = ( 228 | ); 229 | name = Coordinators; 230 | productName = Coordinators; 231 | productReference = 1C1DFCD3241E643000612927 /* Coordinators.app */; 232 | productType = "com.apple.product-type.application"; 233 | }; 234 | /* End PBXNativeTarget section */ 235 | 236 | /* Begin PBXProject section */ 237 | 1C1DFCCB241E642F00612927 /* Project object */ = { 238 | isa = PBXProject; 239 | attributes = { 240 | LastSwiftUpdateCheck = 1120; 241 | LastUpgradeCheck = 1120; 242 | ORGANIZATIONNAME = Zafar; 243 | TargetAttributes = { 244 | 1C1DFCD2241E643000612927 = { 245 | CreatedOnToolsVersion = 11.2.1; 246 | }; 247 | }; 248 | }; 249 | buildConfigurationList = 1C1DFCCE241E642F00612927 /* Build configuration list for PBXProject "Coordinators" */; 250 | compatibilityVersion = "Xcode 9.3"; 251 | developmentRegion = en; 252 | hasScannedForEncodings = 0; 253 | knownRegions = ( 254 | en, 255 | Base, 256 | ); 257 | mainGroup = 1C1DFCCA241E642F00612927; 258 | productRefGroup = 1C1DFCD4241E643000612927 /* Products */; 259 | projectDirPath = ""; 260 | projectRoot = ""; 261 | targets = ( 262 | 1C1DFCD2241E643000612927 /* Coordinators */, 263 | ); 264 | }; 265 | /* End PBXProject section */ 266 | 267 | /* Begin PBXResourcesBuildPhase section */ 268 | 1C1DFCD1241E643000612927 /* Resources */ = { 269 | isa = PBXResourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | 1C1DFCE3241E643100612927 /* LaunchScreen.storyboard in Resources */, 273 | 1C1DFCE0241E643100612927 /* Assets.xcassets in Resources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | /* End PBXResourcesBuildPhase section */ 278 | 279 | /* Begin PBXSourcesBuildPhase section */ 280 | 1C1DFCCF241E643000612927 /* Sources */ = { 281 | isa = PBXSourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 1C776544241E989200E70457 /* AppCoordinator.swift in Sources */, 285 | 1CD7964E241F471C00A2DC72 /* HistoryDetailViewController.swift in Sources */, 286 | 1CD7963F241EBEB200A2DC72 /* SearchViewController.swift in Sources */, 287 | 1CD7964C241F471400A2DC72 /* HistoryDetailCoordinator.swift in Sources */, 288 | 1CE513A7241E64D0008FAE23 /* TabBarController.swift in Sources */, 289 | 1CD79652241F472F00A2DC72 /* SearchDetailViewController.swift in Sources */, 290 | 1CD7963B241EBEA200A2DC72 /* HistoryCoordinator.swift in Sources */, 291 | 1CD79648241F415100A2DC72 /* TopRatedDetailCoordinator.swift in Sources */, 292 | 1CD79643241EBEEA00A2DC72 /* TopRatedCoordinator.swift in Sources */, 293 | 1C1DFCD7241E643000612927 /* AppDelegate.swift in Sources */, 294 | 1CD79641241EBEE300A2DC72 /* TopRatedViewController.swift in Sources */, 295 | 1C776548241EBB3700E70457 /* TabBarCoordinator.swift in Sources */, 296 | 1C776541241E96C400E70457 /* Coordinator.swift in Sources */, 297 | 1CD79654241F87A600A2DC72 /* HistoryItem.swift in Sources */, 298 | 1CD7963D241EBEAB00A2DC72 /* SearchCoordinator.swift in Sources */, 299 | 1CE513AB241E6560008FAE23 /* StartCoordinator.swift in Sources */, 300 | 1CE513A5241E64C5008FAE23 /* StartViewController.swift in Sources */, 301 | 1CD79650241F472700A2DC72 /* SearchDetailCoordinator.swift in Sources */, 302 | 1CD79646241F414800A2DC72 /* TopRatedDetailViewController.swift in Sources */, 303 | 1CD79639241EBE9500A2DC72 /* HistoryViewController.swift in Sources */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | /* End PBXSourcesBuildPhase section */ 308 | 309 | /* Begin PBXVariantGroup section */ 310 | 1C1DFCE1241E643100612927 /* LaunchScreen.storyboard */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | 1C1DFCE2241E643100612927 /* Base */, 314 | ); 315 | name = LaunchScreen.storyboard; 316 | sourceTree = ""; 317 | }; 318 | /* End PBXVariantGroup section */ 319 | 320 | /* Begin XCBuildConfiguration section */ 321 | 1C1DFCE5241E643100612927 /* Debug */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 328 | CLANG_CXX_LIBRARY = "libc++"; 329 | CLANG_ENABLE_MODULES = YES; 330 | CLANG_ENABLE_OBJC_ARC = YES; 331 | CLANG_ENABLE_OBJC_WEAK = YES; 332 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 333 | CLANG_WARN_BOOL_CONVERSION = YES; 334 | CLANG_WARN_COMMA = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 339 | CLANG_WARN_EMPTY_BODY = YES; 340 | CLANG_WARN_ENUM_CONVERSION = YES; 341 | CLANG_WARN_INFINITE_RECURSION = YES; 342 | CLANG_WARN_INT_CONVERSION = YES; 343 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 344 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 345 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 347 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 348 | CLANG_WARN_STRICT_PROTOTYPES = YES; 349 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 350 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 351 | CLANG_WARN_UNREACHABLE_CODE = YES; 352 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 353 | COPY_PHASE_STRIP = NO; 354 | DEBUG_INFORMATION_FORMAT = dwarf; 355 | ENABLE_STRICT_OBJC_MSGSEND = YES; 356 | ENABLE_TESTABILITY = YES; 357 | GCC_C_LANGUAGE_STANDARD = gnu11; 358 | GCC_DYNAMIC_NO_PIC = NO; 359 | GCC_NO_COMMON_BLOCKS = YES; 360 | GCC_OPTIMIZATION_LEVEL = 0; 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 367 | GCC_WARN_UNDECLARED_SELECTOR = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 369 | GCC_WARN_UNUSED_FUNCTION = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 372 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 373 | MTL_FAST_MATH = YES; 374 | ONLY_ACTIVE_ARCH = YES; 375 | SDKROOT = iphoneos; 376 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 377 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 378 | }; 379 | name = Debug; 380 | }; 381 | 1C1DFCE6241E643100612927 /* Release */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | ALWAYS_SEARCH_USER_PATHS = NO; 385 | CLANG_ANALYZER_NONNULL = YES; 386 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 387 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 388 | CLANG_CXX_LIBRARY = "libc++"; 389 | CLANG_ENABLE_MODULES = YES; 390 | CLANG_ENABLE_OBJC_ARC = YES; 391 | CLANG_ENABLE_OBJC_WEAK = YES; 392 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 393 | CLANG_WARN_BOOL_CONVERSION = YES; 394 | CLANG_WARN_COMMA = YES; 395 | CLANG_WARN_CONSTANT_CONVERSION = YES; 396 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 397 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 398 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INFINITE_RECURSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 405 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 407 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 408 | CLANG_WARN_STRICT_PROTOTYPES = YES; 409 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 410 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | COPY_PHASE_STRIP = NO; 414 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 415 | ENABLE_NS_ASSERTIONS = NO; 416 | ENABLE_STRICT_OBJC_MSGSEND = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu11; 418 | GCC_NO_COMMON_BLOCKS = YES; 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 13.2; 426 | MTL_ENABLE_DEBUG_INFO = NO; 427 | MTL_FAST_MATH = YES; 428 | SDKROOT = iphoneos; 429 | SWIFT_COMPILATION_MODE = wholemodule; 430 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 431 | VALIDATE_PRODUCT = YES; 432 | }; 433 | name = Release; 434 | }; 435 | 1C1DFCE8241E643100612927 /* Debug */ = { 436 | isa = XCBuildConfiguration; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CODE_SIGN_STYLE = Automatic; 440 | DEVELOPMENT_TEAM = MJWVGRX9VD; 441 | INFOPLIST_FILE = "Coordinators/Supporting Files/Info.plist"; 442 | LD_RUNPATH_SEARCH_PATHS = ( 443 | "$(inherited)", 444 | "@executable_path/Frameworks", 445 | ); 446 | PRODUCT_BUNDLE_IDENTIFIER = com.zafar.Coordinators; 447 | PRODUCT_NAME = "$(TARGET_NAME)"; 448 | SWIFT_VERSION = 5.0; 449 | TARGETED_DEVICE_FAMILY = "1,2"; 450 | }; 451 | name = Debug; 452 | }; 453 | 1C1DFCE9241E643100612927 /* Release */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 457 | CODE_SIGN_STYLE = Automatic; 458 | DEVELOPMENT_TEAM = MJWVGRX9VD; 459 | INFOPLIST_FILE = "Coordinators/Supporting Files/Info.plist"; 460 | LD_RUNPATH_SEARCH_PATHS = ( 461 | "$(inherited)", 462 | "@executable_path/Frameworks", 463 | ); 464 | PRODUCT_BUNDLE_IDENTIFIER = com.zafar.Coordinators; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | SWIFT_VERSION = 5.0; 467 | TARGETED_DEVICE_FAMILY = "1,2"; 468 | }; 469 | name = Release; 470 | }; 471 | /* End XCBuildConfiguration section */ 472 | 473 | /* Begin XCConfigurationList section */ 474 | 1C1DFCCE241E642F00612927 /* Build configuration list for PBXProject "Coordinators" */ = { 475 | isa = XCConfigurationList; 476 | buildConfigurations = ( 477 | 1C1DFCE5241E643100612927 /* Debug */, 478 | 1C1DFCE6241E643100612927 /* Release */, 479 | ); 480 | defaultConfigurationIsVisible = 0; 481 | defaultConfigurationName = Release; 482 | }; 483 | 1C1DFCE7241E643100612927 /* Build configuration list for PBXNativeTarget "Coordinators" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 1C1DFCE8241E643100612927 /* Debug */, 487 | 1C1DFCE9241E643100612927 /* Release */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 1C1DFCCB241E642F00612927 /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /Coordinators.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Coordinators.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Coordinators.xcodeproj/xcuserdata/zafar.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /Coordinators.xcodeproj/xcuserdata/zafar.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Coordinators.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Coordinators/App/AppCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/15/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AppCoordinator: Coordinator { 12 | let window: UIWindow 13 | 14 | init(window: UIWindow) { 15 | self.window = window 16 | } 17 | 18 | func start() { 19 | let navigationController = UINavigationController() 20 | window.rootViewController = navigationController 21 | window.makeKeyAndVisible() 22 | 23 | let startCoordinator = StartCoordinator(navigationController: navigationController) 24 | coordinate(to: startCoordinator) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Coordinators/App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/15/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | var coordinator: AppCoordinator? 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | 19 | window = UIWindow() 20 | coordinator = AppCoordinator(window: window!) 21 | coordinator?.start() 22 | 23 | return true 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Coordinators/Base/Coordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Coordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/15/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol Coordinator { 12 | func start() 13 | func coordinate(to coordinator: Coordinator) 14 | } 15 | 16 | extension Coordinator { 17 | func coordinate(to coordinator: Coordinator) { 18 | coordinator.start() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Coordinators/Presentation/History Detail/HistoryDetailCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoryDetailCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol HistoryDetailFlow { 12 | func dismissDetail() 13 | } 14 | 15 | class HistoryDetailCoordinator: Coordinator, HistoryDetailFlow { 16 | let navigationController: UINavigationController 17 | let historyItemTitle: String 18 | 19 | init(navigationController: UINavigationController, 20 | historyItemTitle: String) { 21 | 22 | self.navigationController = navigationController 23 | self.historyItemTitle = historyItemTitle 24 | } 25 | 26 | func start() { 27 | let historyDetailViewController = HistoryDetailViewController() 28 | historyDetailViewController.historyItemTitle = historyItemTitle 29 | historyDetailViewController.coordinator = self 30 | 31 | navigationController.present(historyDetailViewController, animated: true, completion: nil) 32 | } 33 | 34 | // MARK: - Flow Methods 35 | func dismissDetail() { 36 | navigationController.dismiss(animated: true, completion: nil) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Coordinators/Presentation/History Detail/HistoryDetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoryDetailViewController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HistoryDetailViewController: UIViewController { 12 | 13 | // MARK: - Lifecycle 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | setupUI() 17 | } 18 | 19 | // MARK: - Actions 20 | @objc func dismissDetailTapped(_ sender: UIButton) { 21 | coordinator?.dismissDetail() 22 | } 23 | 24 | // MARK: - Properties 25 | var coordinator: HistoryDetailFlow? 26 | var historyItemTitle: String? { 27 | didSet { 28 | self.titleLabel.text = historyItemTitle 29 | } 30 | } 31 | 32 | let titleLabel: UILabel = { 33 | let label = UILabel() 34 | label.textColor = .systemIndigo 35 | label.translatesAutoresizingMaskIntoConstraints = false 36 | return label 37 | }() 38 | 39 | let dismissDetailButton: UIButton = { 40 | let button = UIButton() 41 | button.setTitle("Dismiss detail", for: .normal) 42 | button.setTitleColor(.white, for: .normal) 43 | button.backgroundColor = UIColor.systemGray 44 | button.layer.cornerRadius = 10 45 | button.layer.shadowRadius = 5 46 | button.layer.shadowColor = UIColor.gray.cgColor 47 | button.layer.shadowOpacity = 1.0 48 | button.layer.shadowOffset = CGSize(width: -1, height: 3) 49 | button.addTarget(self, action: #selector(dismissDetailTapped), for: .touchUpInside) 50 | button.translatesAutoresizingMaskIntoConstraints = false 51 | return button 52 | }() 53 | 54 | } 55 | 56 | // MARK: - UI Setup 57 | extension HistoryDetailViewController { 58 | private func setupUI() { 59 | if #available(iOS 13.0, *) { 60 | overrideUserInterfaceStyle = .light 61 | } 62 | self.view.backgroundColor = .white 63 | self.view.addSubview(titleLabel) 64 | self.view.addSubview(dismissDetailButton) 65 | 66 | NSLayoutConstraint.activate([ 67 | titleLabel.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), 68 | titleLabel.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 20), 69 | 70 | dismissDetailButton.widthAnchor 71 | .constraint(equalToConstant: UIScreen.main.bounds.width / 3), 72 | dismissDetailButton.heightAnchor 73 | .constraint(equalToConstant: 50), 74 | dismissDetailButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), 75 | dismissDetailButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor) 76 | ]) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Coordinators/Presentation/History/HistoryCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoryCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol HistoryFlow { 12 | func coordinateToDetail(with title: String) 13 | } 14 | 15 | class HistoryCoordinator: Coordinator, HistoryFlow { 16 | 17 | weak var navigationController: UINavigationController? 18 | 19 | init(navigationController: UINavigationController) { 20 | self.navigationController = navigationController 21 | } 22 | 23 | func start() { 24 | let historyViewController = HistoryViewController() 25 | historyViewController.coordinator = self 26 | 27 | navigationController?.pushViewController(historyViewController, animated: false) 28 | } 29 | 30 | // MARK: - Flow Methods 31 | func coordinateToDetail(with title: String) { 32 | let historyDetailCoordinator = HistoryDetailCoordinator( 33 | navigationController: navigationController!, 34 | historyItemTitle: title 35 | ) 36 | 37 | coordinate(to: historyDetailCoordinator) 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Coordinators/Presentation/History/HistoryItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoryItem.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct HistoryItem { 12 | let title: String 13 | } 14 | -------------------------------------------------------------------------------- /Coordinators/Presentation/History/HistoryViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoryViewController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HistoryViewController: UIViewController { 12 | 13 | // MARK: - Lifecycle 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | setupUI() 17 | } 18 | 19 | // MARK: - Properties 20 | var coordinator: HistoryFlow? 21 | 22 | let historyItems: [HistoryItem] = [.init(title: "First item"), 23 | .init(title: "Second item"), 24 | .init(title: "Third item"), 25 | .init(title: "Fourth item")] 26 | 27 | lazy var tableView: UITableView = { 28 | let tableView = UITableView() 29 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell") 30 | tableView.delegate = self 31 | tableView.dataSource = self 32 | tableView.translatesAutoresizingMaskIntoConstraints = false 33 | return tableView 34 | }() 35 | } 36 | 37 | // MARK: - UITableView Delegate & Data Source 38 | extension HistoryViewController: UITableViewDelegate, UITableViewDataSource { 39 | 40 | func numberOfSections(in tableView: UITableView) -> Int { 41 | return 1 42 | } 43 | 44 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 45 | return historyItems.count 46 | } 47 | 48 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 49 | let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")! 50 | cell.textLabel?.text = historyItems[indexPath.row].title 51 | return cell 52 | } 53 | 54 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 55 | coordinator?.coordinateToDetail(with: historyItems[indexPath.row].title) 56 | tableView.deselectRow(at: indexPath, animated: true) 57 | } 58 | } 59 | 60 | // MARK: - UI Setup 61 | extension HistoryViewController { 62 | private func setupUI() { 63 | if #available(iOS 13.0, *) { 64 | overrideUserInterfaceStyle = .light 65 | } 66 | 67 | self.view.backgroundColor = .white 68 | self.view.addSubview(tableView) 69 | 70 | NSLayoutConstraint.activate([ 71 | tableView.widthAnchor 72 | .constraint(equalTo: self.view.widthAnchor), 73 | tableView.heightAnchor 74 | .constraint(equalTo: self.view.heightAnchor) 75 | ]) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Search Detail/SearchDetailCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchDetailCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol SearchDetailFlow { 12 | func dismissDetail() 13 | } 14 | 15 | class SearchDetailCoordinator: Coordinator, SearchDetailFlow { 16 | let navigationController: UINavigationController 17 | 18 | init(navigationController: UINavigationController) { 19 | self.navigationController = navigationController 20 | } 21 | 22 | func start() { 23 | let searchDetailViewController = SearchDetailViewController() 24 | searchDetailViewController.coordinator = self 25 | 26 | navigationController.present(searchDetailViewController, animated: true, completion: nil) 27 | } 28 | 29 | // MARK: - Flow Methods 30 | func dismissDetail() { 31 | navigationController.dismiss(animated: true, completion: nil) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Search Detail/SearchDetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchDetailViewController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SearchDetailViewController: UIViewController { 12 | 13 | // MARK: - Lifecycle 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | setupUI() 17 | } 18 | 19 | // MARK: - Actions 20 | @objc func dismissDetailTapped(_ sender: UIButton) { 21 | coordinator?.dismissDetail() 22 | } 23 | 24 | // MARK: - Properties 25 | var coordinator: SearchDetailFlow? 26 | 27 | let dismissDetailButton: UIButton = { 28 | let button = UIButton() 29 | button.setTitle("Dismiss detail", for: .normal) 30 | button.setTitleColor(.white, for: .normal) 31 | button.backgroundColor = UIColor.systemGray 32 | button.layer.cornerRadius = 10 33 | button.layer.shadowRadius = 5 34 | button.layer.shadowColor = UIColor.gray.cgColor 35 | button.layer.shadowOpacity = 1.0 36 | button.layer.shadowOffset = CGSize(width: -1, height: 3) 37 | button.addTarget(self, action: #selector(dismissDetailTapped), for: .touchUpInside) 38 | button.translatesAutoresizingMaskIntoConstraints = false 39 | return button 40 | }() 41 | 42 | } 43 | 44 | // MARK: - UI Setup 45 | extension SearchDetailViewController { 46 | private func setupUI() { 47 | if #available(iOS 13.0, *) { 48 | overrideUserInterfaceStyle = .light 49 | } 50 | self.view.backgroundColor = .white 51 | self.view.addSubview(dismissDetailButton) 52 | 53 | NSLayoutConstraint.activate([ 54 | dismissDetailButton.widthAnchor 55 | .constraint(equalToConstant: UIScreen.main.bounds.width / 3), 56 | dismissDetailButton.heightAnchor 57 | .constraint(equalToConstant: 50), 58 | dismissDetailButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), 59 | dismissDetailButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor) 60 | ]) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Search/SearchCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol SearchFlow: class { 12 | func coordinateToDetail() 13 | } 14 | 15 | class SearchCoordinator: Coordinator, SearchFlow { 16 | 17 | weak var navigationController: UINavigationController? 18 | 19 | init(navigationController: UINavigationController) { 20 | self.navigationController = navigationController 21 | } 22 | 23 | func start() { 24 | let searchViewController = SearchViewController() 25 | searchViewController.coordinator = self 26 | 27 | navigationController?.pushViewController(searchViewController, animated: false) 28 | } 29 | 30 | // MARK: - Flow Methods 31 | func coordinateToDetail() { 32 | let searchDetailCoordinator = SearchDetailCoordinator(navigationController: navigationController!) 33 | coordinate(to: searchDetailCoordinator) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Search/SearchViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchViewController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SearchViewController: UIViewController { 12 | 13 | // MARK: - Lifecycle 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | setupUI() 17 | } 18 | 19 | // MARK: - Actions 20 | @objc func showDetailTapped(_ sender: UIButton) { 21 | coordinator?.coordinateToDetail() 22 | } 23 | 24 | // MARK: - Properties 25 | var coordinator: SearchFlow? 26 | 27 | let showDetailButton: UIButton = { 28 | let button = UIButton() 29 | button.setTitle("Show detail", for: .normal) 30 | button.setTitleColor(.white, for: .normal) 31 | button.backgroundColor = UIColor.systemGreen 32 | button.layer.cornerRadius = 10 33 | button.layer.shadowRadius = 5 34 | button.layer.shadowColor = UIColor.green.cgColor 35 | button.layer.shadowOpacity = 1.0 36 | button.layer.shadowOffset = CGSize(width: -1, height: 3) 37 | button.addTarget(self, action: #selector(showDetailTapped), for: .touchUpInside) 38 | button.translatesAutoresizingMaskIntoConstraints = false 39 | return button 40 | }() 41 | } 42 | 43 | // MARK: - UI Setup 44 | extension SearchViewController { 45 | private func setupUI() { 46 | if #available(iOS 13.0, *) { 47 | overrideUserInterfaceStyle = .light 48 | } 49 | 50 | self.view.backgroundColor = .white 51 | self.view.addSubview(showDetailButton) 52 | 53 | NSLayoutConstraint.activate([ 54 | showDetailButton.widthAnchor 55 | .constraint(equalToConstant: UIScreen.main.bounds.width / 3), 56 | showDetailButton.heightAnchor 57 | .constraint(equalToConstant: 50), 58 | showDetailButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), 59 | showDetailButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor) 60 | ]) 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Start/StartCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StartCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/15/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol StartFlow: class { 12 | func coordinateToTabBar() 13 | } 14 | 15 | class StartCoordinator: Coordinator, StartFlow { 16 | let navigationController: UINavigationController 17 | 18 | init(navigationController: UINavigationController) { 19 | self.navigationController = navigationController 20 | } 21 | 22 | func start() { 23 | let startViewController = StartViewController() 24 | startViewController.coordinator = self 25 | navigationController.pushViewController(startViewController, animated: true) 26 | } 27 | 28 | // MARK: - Flow Methods 29 | func coordinateToTabBar() { 30 | let tabBarCoordinator = TabBarCoordinator(navigationController: navigationController) 31 | coordinate(to: tabBarCoordinator) 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Start/StartViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StartViewController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/15/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class StartViewController: UIViewController { 12 | 13 | // MARK: - Lifecycle 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | setupUI() 17 | } 18 | 19 | // MARK: - Actions 20 | @objc func startTapped(_ sender: UIButton) { 21 | coordinator?.coordinateToTabBar() 22 | } 23 | 24 | // MARK: - Properties 25 | var coordinator: StartFlow? 26 | 27 | let startButton: UIButton = { 28 | let button = UIButton() 29 | button.setTitle("Start!", for: .normal) 30 | button.setTitleColor(.white, for: .normal) 31 | button.backgroundColor = UIColor.systemBlue 32 | button.layer.cornerRadius = 10 33 | button.layer.shadowRadius = 5 34 | button.layer.shadowColor = UIColor.systemTeal.cgColor 35 | button.layer.shadowOpacity = 1.0 36 | button.layer.shadowOffset = CGSize(width: -1, height: 3) 37 | button.addTarget(self, action: #selector(startTapped), for: .touchUpInside) 38 | button.translatesAutoresizingMaskIntoConstraints = false 39 | return button 40 | }() 41 | 42 | } 43 | 44 | // MARK: - UI Setup 45 | extension StartViewController { 46 | private func setupUI() { 47 | if #available(iOS 13.0, *) { 48 | overrideUserInterfaceStyle = .light 49 | } 50 | self.view.backgroundColor = .white 51 | self.view.addSubview(startButton) 52 | 53 | NSLayoutConstraint.activate([ 54 | startButton.widthAnchor 55 | .constraint(equalToConstant: UIScreen.main.bounds.width / 3), 56 | startButton.heightAnchor 57 | .constraint(equalToConstant: 50), 58 | startButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), 59 | startButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor) 60 | ]) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Tab Bar/TabBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/15/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TabBarController: UITabBarController { 12 | 13 | override func viewDidLoad() { 14 | self.tabBar.layer.masksToBounds = true 15 | self.tabBar.barStyle = .black 16 | self.tabBar.barTintColor = .white 17 | self.tabBar.tintColor = UIColor.orange 18 | 19 | self.tabBar.layer.shadowColor = UIColor.lightGray.cgColor 20 | self.tabBar.layer.shadowOffset = CGSize(width: 0.0, height: 4.0) 21 | self.tabBar.layer.shadowRadius = 10 22 | self.tabBar.layer.shadowOpacity = 1 23 | self.tabBar.layer.masksToBounds = false 24 | } 25 | 26 | var coordinator: TabBarCoordinator? 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Tab Bar/TabBarCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TabBarCoordinator: Coordinator { 12 | let navigationController: UINavigationController 13 | 14 | init(navigationController: UINavigationController) { 15 | self.navigationController = navigationController 16 | } 17 | 18 | func start() { 19 | let tabBarController = TabBarController() 20 | tabBarController.coordinator = self 21 | 22 | let topRatedNavigationController = UINavigationController() 23 | topRatedNavigationController.tabBarItem = UITabBarItem(tabBarSystemItem: .topRated, tag: 0) 24 | let topRatedCoordinator = TopRatedCoordinator(navigationController: topRatedNavigationController) 25 | 26 | let searchNavigationController = UINavigationController() 27 | searchNavigationController.tabBarItem = UITabBarItem( 28 | tabBarSystemItem: .search, tag: 1) 29 | let searchCoordinator = SearchCoordinator(navigationController: searchNavigationController) 30 | 31 | let historyNavigationController = UINavigationController() 32 | historyNavigationController.tabBarItem = UITabBarItem( 33 | tabBarSystemItem: .history, tag: 2) 34 | let historyCoordinator = HistoryCoordinator(navigationController: historyNavigationController) 35 | 36 | tabBarController.viewControllers = [topRatedNavigationController, 37 | searchNavigationController, 38 | historyNavigationController] 39 | 40 | tabBarController.modalPresentationStyle = .fullScreen 41 | navigationController.present(tabBarController, animated: true, completion: nil) 42 | 43 | coordinate(to: topRatedCoordinator) 44 | coordinate(to: searchCoordinator) 45 | coordinate(to: historyCoordinator) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Top Rated Detail/TopRatedDetailCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TopRatedDetailCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol TopRatedDetailFlow: class { 12 | func dismissDetail() 13 | } 14 | 15 | class TopRatedDetailCoordinator: Coordinator, TopRatedDetailFlow { 16 | let navigationController: UINavigationController 17 | 18 | init(navigationController: UINavigationController) { 19 | self.navigationController = navigationController 20 | } 21 | 22 | func start() { 23 | let topRatedDetailViewController = TopRatedDetailViewController() 24 | topRatedDetailViewController.coordinator = self 25 | 26 | navigationController.present(topRatedDetailViewController, animated: true, completion: nil) 27 | } 28 | 29 | // MARK: - Flow Methods 30 | func dismissDetail() { 31 | navigationController.dismiss(animated: true, completion: nil) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Top Rated Detail/TopRatedDetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TopRatedDetailViewController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TopRatedDetailViewController: UIViewController { 12 | 13 | // MARK: - Lifecycle 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | setupUI() 17 | } 18 | 19 | // MARK: - Actions 20 | @objc func dismissDetailTapped(_ sender: UIButton) { 21 | coordinator?.dismissDetail() 22 | } 23 | 24 | // MARK: - Properties 25 | var coordinator: TopRatedDetailFlow? 26 | 27 | let dismissDetailButton: UIButton = { 28 | let button = UIButton() 29 | button.setTitle("Dismiss detail", for: .normal) 30 | button.setTitleColor(.white, for: .normal) 31 | button.backgroundColor = UIColor.systemGray 32 | button.layer.cornerRadius = 10 33 | button.layer.shadowRadius = 5 34 | button.layer.shadowColor = UIColor.gray.cgColor 35 | button.layer.shadowOpacity = 1.0 36 | button.layer.shadowOffset = CGSize(width: -1, height: 3) 37 | button.addTarget(self, action: #selector(dismissDetailTapped), for: .touchUpInside) 38 | button.translatesAutoresizingMaskIntoConstraints = false 39 | return button 40 | }() 41 | 42 | } 43 | 44 | // MARK: - UI Setup 45 | extension TopRatedDetailViewController { 46 | private func setupUI() { 47 | if #available(iOS 13.0, *) { 48 | overrideUserInterfaceStyle = .light 49 | } 50 | self.view.backgroundColor = .white 51 | self.view.addSubview(dismissDetailButton) 52 | 53 | NSLayoutConstraint.activate([ 54 | dismissDetailButton.widthAnchor 55 | .constraint(equalToConstant: UIScreen.main.bounds.width / 3), 56 | dismissDetailButton.heightAnchor 57 | .constraint(equalToConstant: 50), 58 | dismissDetailButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), 59 | dismissDetailButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor) 60 | ]) 61 | } 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Top Rated/TopRatedCoordinator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TopRatedCoordinator.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol TopRatedFlow: class { 12 | func coordinateToDetail() 13 | } 14 | 15 | class TopRatedCoordinator: Coordinator, TopRatedFlow { 16 | 17 | weak var navigationController: UINavigationController? 18 | 19 | init(navigationController: UINavigationController) { 20 | self.navigationController = navigationController 21 | } 22 | 23 | func start() { 24 | let topRatedViewController = TopRatedViewController() 25 | topRatedViewController.coordinator = self 26 | 27 | navigationController?.pushViewController(topRatedViewController, animated: false) 28 | } 29 | 30 | // MARK: - Flow Methods 31 | func coordinateToDetail() { 32 | let topRatedDetailCoordinator = TopRatedDetailCoordinator(navigationController: navigationController!) 33 | coordinate(to: topRatedDetailCoordinator) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Coordinators/Presentation/Top Rated/TopRatedViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TopRatedViewController.swift 3 | // Coordinators 4 | // 5 | // Created by Zafar on 3/16/20. 6 | // Copyright © 2020 Zafar. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TopRatedViewController: UIViewController { 12 | 13 | // MARK: - Lifecycle 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | setupUI() 17 | } 18 | 19 | // MARK: - Actions 20 | @objc func showDetailTapped(_ sender: UIButton) { 21 | coordinator?.coordinateToDetail() 22 | } 23 | 24 | // MARK: - Properties 25 | var coordinator: TopRatedFlow? 26 | 27 | let showDetailButton: UIButton = { 28 | let button = UIButton() 29 | button.setTitle("Show detail", for: .normal) 30 | button.setTitleColor(.white, for: .normal) 31 | button.backgroundColor = UIColor.systemOrange 32 | button.layer.cornerRadius = 10 33 | button.layer.shadowRadius = 5 34 | button.layer.shadowColor = UIColor.orange.cgColor 35 | button.layer.shadowOpacity = 1.0 36 | button.layer.shadowOffset = CGSize(width: -1, height: 3) 37 | button.addTarget(self, action: #selector(showDetailTapped), for: .touchUpInside) 38 | button.translatesAutoresizingMaskIntoConstraints = false 39 | return button 40 | }() 41 | } 42 | 43 | // MARK: - UI Setup 44 | extension TopRatedViewController { 45 | private func setupUI() { 46 | if #available(iOS 13.0, *) { 47 | overrideUserInterfaceStyle = .light 48 | } 49 | 50 | self.view.backgroundColor = .white 51 | self.view.addSubview(showDetailButton) 52 | 53 | NSLayoutConstraint.activate([ 54 | showDetailButton.widthAnchor 55 | .constraint(equalToConstant: UIScreen.main.bounds.width / 3), 56 | showDetailButton.heightAnchor 57 | .constraint(equalToConstant: 50), 58 | showDetailButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), 59 | showDetailButton.centerYAnchor.constraint(equalTo: self.view.centerYAnchor) 60 | ]) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Coordinators/Supporting Files/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 | } -------------------------------------------------------------------------------- /Coordinators/Supporting Files/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Coordinators/Supporting Files/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 | -------------------------------------------------------------------------------- /Coordinators/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | --------------------------------------------------------------------------------