Skip to content

Commit

Permalink
Character Model
Browse files Browse the repository at this point in the history
  • Loading branch information
swg99 committed Aug 9, 2021
1 parent 73016c6 commit 4e0627b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
1711B39E26B1898100BE935B /* CharacterListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1711B39D26B1898100BE935B /* CharacterListView.swift */; };
17588BAC26C1750B008ECC31 /* Character.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17588BAB26C1750B008ECC31 /* Character.swift */; };
B811686D1CFF1C9900301A0A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B811686C1CFF1C9900301A0A /* AppDelegate.swift */; };
B81168761CFF1C9900301A0A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B81168751CFF1C9900301A0A /* Assets.xcassets */; };
B81168791CFF1C9900301A0A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B81168771CFF1C9900301A0A /* LaunchScreen.storyboard */; };
Expand All @@ -26,6 +27,7 @@

/* Begin PBXFileReference section */
1711B39D26B1898100BE935B /* CharacterListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterListView.swift; sourceTree = "<group>"; };
17588BAB26C1750B008ECC31 /* Character.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Character.swift; sourceTree = "<group>"; };
B81168691CFF1C9900301A0A /* Rick And Morty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Rick And Morty.app"; sourceTree = BUILT_PRODUCTS_DIR; };
B811686C1CFF1C9900301A0A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
B81168751CFF1C9900301A0A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -54,6 +56,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
17588BAA26C174FB008ECC31 /* Model */ = {
isa = PBXGroup;
children = (
17588BAB26C1750B008ECC31 /* Character.swift */,
);
path = Model;
sourceTree = "<group>";
};
B81168601CFF1C9900301A0A = {
isa = PBXGroup;
children = (
Expand All @@ -75,6 +85,7 @@
B811686B1CFF1C9900301A0A /* Rick And Morty */ = {
isa = PBXGroup;
children = (
17588BAA26C174FB008ECC31 /* Model */,
B811686C1CFF1C9900301A0A /* AppDelegate.swift */,
1711B39D26B1898100BE935B /* CharacterListView.swift */,
B81168751CFF1C9900301A0A /* Assets.xcassets */,
Expand Down Expand Up @@ -197,6 +208,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
17588BAC26C1750B008ECC31 /* Character.swift in Sources */,
1711B39E26B1898100BE935B /* CharacterListView.swift in Sources */,
B811686D1CFF1C9900301A0A /* AppDelegate.swift in Sources */,
);
Expand Down
24 changes: 24 additions & 0 deletions Rick-and-Morty/Rick And Morty/Model/Character.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// Character.swift
// Rick And Morty
//
// Created by Scottie Gray on 2021-08-09.
// Copyright © 2021 Novoda. All rights reserved.
//

import Foundation

struct Character: Decodable {
let id: Int
let name: String
let species: String
let location: LastLocation
let status: String
let image: String
let episode: [String]
}

struct LastLocation: Decodable {
let name: String
let url: String
}

0 comments on commit 4e0627b

Please sign in to comment.