diff --git a/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj b/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj index 22fac9a..0bc78fd 100644 --- a/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj +++ b/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 1711B39C26B16D6200BE935B /* CharactersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1711B39B26B16D6200BE935B /* CharactersView.swift */; }; 1711B39E26B1898100BE935B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1711B39D26B1898100BE935B /* ContentView.swift */; }; + 171752C126B3FD50007B1A60 /* CharacterDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 171752C026B3FD50007B1A60 /* CharacterDetailView.swift */; }; 17CAB4FA26A824470048F2F1 /* CharacterCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17CAB4F926A824470048F2F1 /* CharacterCell.swift */; }; 17F1E38626A1AF6A009C1CDB /* Character.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F1E38526A1AF6A009C1CDB /* Character.swift */; }; 17F1E38D26A1DCF0009C1CDB /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F1E38C26A1DCF0009C1CDB /* Data.swift */; }; @@ -33,6 +34,7 @@ /* Begin PBXFileReference section */ 1711B39B26B16D6200BE935B /* CharactersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharactersView.swift; sourceTree = ""; }; 1711B39D26B1898100BE935B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 171752C026B3FD50007B1A60 /* CharacterDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterDetailView.swift; sourceTree = ""; }; 17CAB4F926A824470048F2F1 /* CharacterCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterCell.swift; sourceTree = ""; }; 17F1E38526A1AF6A009C1CDB /* Character.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Character.swift; sourceTree = ""; }; 17F1E38C26A1DCF0009C1CDB /* Data.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; @@ -83,6 +85,7 @@ 17CAB4F926A824470048F2F1 /* CharacterCell.swift */, 1711B39B26B16D6200BE935B /* CharactersView.swift */, 1711B39D26B1898100BE935B /* ContentView.swift */, + 171752C026B3FD50007B1A60 /* CharacterDetailView.swift */, ); path = Views; sourceTree = ""; @@ -231,6 +234,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 171752C126B3FD50007B1A60 /* CharacterDetailView.swift in Sources */, 17F1E38D26A1DCF0009C1CDB /* Data.swift in Sources */, 1711B39E26B1898100BE935B /* ContentView.swift in Sources */, B811686D1CFF1C9900301A0A /* AppDelegate.swift in Sources */, diff --git a/Rick-and-Morty/Rick And Morty/Views/CharacterDetailView.swift b/Rick-and-Morty/Rick And Morty/Views/CharacterDetailView.swift new file mode 100644 index 0000000..c419143 --- /dev/null +++ b/Rick-and-Morty/Rick And Morty/Views/CharacterDetailView.swift @@ -0,0 +1,36 @@ +// +// CharacterDetailView.swift +// Rick And Morty +// +// Created by Scottie Gray on 2021-07-30. +// Copyright © 2021 Novoda. All rights reserved. +// + +import SwiftUI + +struct CharacterDetailView: View { + let character: Character + + var body: some View { + VStack { + Image(character.image) + .resizable() + .scaledToFit() + .frame(maxHeight: 200) + HStack { + Text(character.description) + Spacer() + } + Spacer() + } + .padding() + .navigationTitle(character.name) + } +} + +struct CharacterDetailView_Previews: PreviewProvider { + static var previews: some View { + CharacterDetailView(character: ricks[0]) + CharacterDetailView(character: morties[0]) + } +}