diff --git a/SpaceX.xcodeproj/project.pbxproj b/SpaceX.xcodeproj/project.pbxproj index 4ceb494..a93678f 100644 --- a/SpaceX.xcodeproj/project.pbxproj +++ b/SpaceX.xcodeproj/project.pbxproj @@ -14,7 +14,7 @@ 2297001423159B6800890B17 /* SpaceXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2297001323159B6800890B17 /* SpaceXTests.swift */; }; 2297001F23159B6800890B17 /* SpaceXUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2297001E23159B6800890B17 /* SpaceXUITests.swift */; }; 2297002E2315B12800890B17 /* RocketTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2297002D2315B12800890B17 /* RocketTableViewCell.swift */; }; - 229700302315B38D00890B17 /* Rocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2297002F2315B38D00890B17 /* Rocket.swift */; }; + 229700302315B38D00890B17 /* RocketModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2297002F2315B38D00890B17 /* RocketModel.swift */; }; 229700322315B55B00890B17 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 229700312315B55B00890B17 /* Constants.swift */; }; 2297FFFA23159B6700890B17 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2297FFF923159B6700890B17 /* AppDelegate.swift */; }; 2297FFFC23159B6700890B17 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2297FFFB23159B6700890B17 /* SceneDelegate.swift */; }; @@ -51,7 +51,7 @@ 2297001E23159B6800890B17 /* SpaceXUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpaceXUITests.swift; sourceTree = ""; }; 2297002023159B6800890B17 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 2297002D2315B12800890B17 /* RocketTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RocketTableViewCell.swift; sourceTree = ""; }; - 2297002F2315B38D00890B17 /* Rocket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Rocket.swift; sourceTree = ""; }; + 2297002F2315B38D00890B17 /* RocketModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RocketModel.swift; sourceTree = ""; }; 229700312315B55B00890B17 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; 2297FFF623159B6700890B17 /* SpaceX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpaceX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2297FFF923159B6700890B17 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -84,6 +84,31 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2223DB4D2511AAD200970902 /* Rocket */ = { + isa = PBXGroup; + children = ( + 2297FFFD23159B6700890B17 /* RocketViewController.swift */, + 2297002D2315B12800890B17 /* RocketTableViewCell.swift */, + ); + path = Rocket; + sourceTree = ""; + }; + 2223DB4E2511AAF000970902 /* Model */ = { + isa = PBXGroup; + children = ( + 2297002F2315B38D00890B17 /* RocketModel.swift */, + ); + path = Model; + sourceTree = ""; + }; + 2223DB4F2511AB3400970902 /* Utility */ = { + isa = PBXGroup; + children = ( + 229700312315B55B00890B17 /* Constants.swift */, + ); + path = Utility; + sourceTree = ""; + }; 2297001223159B6800890B17 /* SpaceXTests */ = { isa = PBXGroup; children = ( @@ -102,15 +127,13 @@ path = SpaceXUITests; sourceTree = ""; }; - 2297002C23159B8D00890B17 /* Resources */ = { + 2297002C23159B8D00890B17 /* View */ = { isa = PBXGroup; children = ( 2297FFFF23159B6700890B17 /* Main.storyboard */, - 2297000523159B6800890B17 /* Assets.xcassets */, - 2297000723159B6800890B17 /* LaunchScreen.storyboard */, - 2297000223159B6700890B17 /* SpaceX.xcdatamodeld */, + 2223DB4D2511AAD200970902 /* Rocket */, ); - path = Resources; + path = View; sourceTree = ""; }; 2297FFED23159B6700890B17 = { @@ -138,12 +161,13 @@ children = ( 2297FFF923159B6700890B17 /* AppDelegate.swift */, 2297FFFB23159B6700890B17 /* SceneDelegate.swift */, - 2297FFFD23159B6700890B17 /* RocketViewController.swift */, - 2297002F2315B38D00890B17 /* Rocket.swift */, - 2297002D2315B12800890B17 /* RocketTableViewCell.swift */, - 229700312315B55B00890B17 /* Constants.swift */, - 2297002C23159B8D00890B17 /* Resources */, + 2297000723159B6800890B17 /* LaunchScreen.storyboard */, + 2297000523159B6800890B17 /* Assets.xcassets */, 2297000A23159B6800890B17 /* Info.plist */, + 2297000223159B6700890B17 /* SpaceX.xcdatamodeld */, + 2223DB4E2511AAF000970902 /* Model */, + 2223DB4F2511AB3400970902 /* Utility */, + 2297002C23159B8D00890B17 /* View */, ); path = SpaceX; sourceTree = ""; @@ -298,7 +322,7 @@ 2297002E2315B12800890B17 /* RocketTableViewCell.swift in Sources */, 2297FFFE23159B6700890B17 /* RocketViewController.swift in Sources */, 2297FFFA23159B6700890B17 /* AppDelegate.swift in Sources */, - 229700302315B38D00890B17 /* Rocket.swift in Sources */, + 229700302315B38D00890B17 /* RocketModel.swift in Sources */, 229700322315B55B00890B17 /* Constants.swift in Sources */, 2297FFFC23159B6700890B17 /* SceneDelegate.swift in Sources */, 2297000423159B6700890B17 /* SpaceX.xcdatamodeld in Sources */, diff --git a/SpaceX/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/SpaceX/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from SpaceX/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json rename to SpaceX/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/SpaceX/Resources/Assets.xcassets/Contents.json b/SpaceX/Assets.xcassets/Contents.json similarity index 100% rename from SpaceX/Resources/Assets.xcassets/Contents.json rename to SpaceX/Assets.xcassets/Contents.json diff --git a/SpaceX/Resources/Base.lproj/LaunchScreen.storyboard b/SpaceX/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from SpaceX/Resources/Base.lproj/LaunchScreen.storyboard rename to SpaceX/Base.lproj/LaunchScreen.storyboard diff --git a/SpaceX/Rocket.swift b/SpaceX/Model/RocketModel.swift similarity index 90% rename from SpaceX/Rocket.swift rename to SpaceX/Model/RocketModel.swift index 7840c89..3c62ee9 100644 --- a/SpaceX/Rocket.swift +++ b/SpaceX/Model/RocketModel.swift @@ -8,7 +8,7 @@ import Foundation -struct Rocket: Codable { +struct RocketModel: Codable { // MARK: - Properties diff --git a/SpaceX/Resources/SpaceX.xcdatamodeld/.xccurrentversion b/SpaceX/SpaceX.xcdatamodeld/.xccurrentversion similarity index 100% rename from SpaceX/Resources/SpaceX.xcdatamodeld/.xccurrentversion rename to SpaceX/SpaceX.xcdatamodeld/.xccurrentversion diff --git a/SpaceX/Resources/SpaceX.xcdatamodeld/SpaceX.xcdatamodel/contents b/SpaceX/SpaceX.xcdatamodeld/SpaceX.xcdatamodel/contents similarity index 100% rename from SpaceX/Resources/SpaceX.xcdatamodeld/SpaceX.xcdatamodel/contents rename to SpaceX/SpaceX.xcdatamodeld/SpaceX.xcdatamodel/contents diff --git a/SpaceX/Constants.swift b/SpaceX/Utility/Constants.swift similarity index 100% rename from SpaceX/Constants.swift rename to SpaceX/Utility/Constants.swift diff --git a/SpaceX/Resources/Base.lproj/Main.storyboard b/SpaceX/View/Base.lproj/Main.storyboard similarity index 100% rename from SpaceX/Resources/Base.lproj/Main.storyboard rename to SpaceX/View/Base.lproj/Main.storyboard diff --git a/SpaceX/RocketTableViewCell.swift b/SpaceX/View/Rocket/RocketTableViewCell.swift similarity index 100% rename from SpaceX/RocketTableViewCell.swift rename to SpaceX/View/Rocket/RocketTableViewCell.swift diff --git a/SpaceX/RocketViewController.swift b/SpaceX/View/Rocket/RocketViewController.swift similarity index 95% rename from SpaceX/RocketViewController.swift rename to SpaceX/View/Rocket/RocketViewController.swift index 39e38f9..e72076d 100644 --- a/SpaceX/RocketViewController.swift +++ b/SpaceX/View/Rocket/RocketViewController.swift @@ -12,7 +12,7 @@ class RocketViewController: UIViewController, UITableViewDelegate, UITableViewDa // MARK: - Global variables - lazy var rockets = [Rocket]() + lazy var rockets = [RocketModel]() // MARK: - IBOutlets @@ -77,7 +77,7 @@ class RocketViewController: UIViewController, UITableViewDelegate, UITableViewDa do { if let data = data { let decoder = JSONDecoder() - self.rockets += try decoder.decode([Rocket].self, from: data) + self.rockets += try decoder.decode([RocketModel].self, from: data) DispatchQueue.main.async { self.tableView.reloadData() }