Skip to content

Commit

Permalink
Reorganize source codes and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
victorshinya committed Sep 16, 2020
1 parent 029a094 commit 7048479
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 16 deletions.
50 changes: 37 additions & 13 deletions SpaceX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -51,7 +51,7 @@
2297001E23159B6800890B17 /* SpaceXUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpaceXUITests.swift; sourceTree = "<group>"; };
2297002023159B6800890B17 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2297002D2315B12800890B17 /* RocketTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RocketTableViewCell.swift; sourceTree = "<group>"; };
2297002F2315B38D00890B17 /* Rocket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Rocket.swift; sourceTree = "<group>"; };
2297002F2315B38D00890B17 /* RocketModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RocketModel.swift; sourceTree = "<group>"; };
229700312315B55B00890B17 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
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 = "<group>"; };
Expand Down Expand Up @@ -84,6 +84,31 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
2223DB4D2511AAD200970902 /* Rocket */ = {
isa = PBXGroup;
children = (
2297FFFD23159B6700890B17 /* RocketViewController.swift */,
2297002D2315B12800890B17 /* RocketTableViewCell.swift */,
);
path = Rocket;
sourceTree = "<group>";
};
2223DB4E2511AAF000970902 /* Model */ = {
isa = PBXGroup;
children = (
2297002F2315B38D00890B17 /* RocketModel.swift */,
);
path = Model;
sourceTree = "<group>";
};
2223DB4F2511AB3400970902 /* Utility */ = {
isa = PBXGroup;
children = (
229700312315B55B00890B17 /* Constants.swift */,
);
path = Utility;
sourceTree = "<group>";
};
2297001223159B6800890B17 /* SpaceXTests */ = {
isa = PBXGroup;
children = (
Expand All @@ -102,15 +127,13 @@
path = SpaceXUITests;
sourceTree = "<group>";
};
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 = "<group>";
};
2297FFED23159B6700890B17 = {
Expand Down Expand Up @@ -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 = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion SpaceX/Rocket.swift → SpaceX/Model/RocketModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

struct Rocket: Codable {
struct RocketModel: Codable {

// MARK: - Properties

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class RocketViewController: UIViewController, UITableViewDelegate, UITableViewDa

// MARK: - Global variables

lazy var rockets = [Rocket]()
lazy var rockets = [RocketModel]()

// MARK: - IBOutlets

Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 7048479

Please sign in to comment.