Skip to content

Commit

Permalink
Merge pull request #58 from novoda/feature/rm-57-CharacterDetailView
Browse files Browse the repository at this point in the history
Feature [RM57] CharacterDetailView
  • Loading branch information
swg99 authored Jul 30, 2021
2 parents fdf03cb + a004723 commit 94b8c64
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -33,6 +34,7 @@
/* Begin PBXFileReference section */
1711B39B26B16D6200BE935B /* CharactersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharactersView.swift; sourceTree = "<group>"; };
1711B39D26B1898100BE935B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
171752C026B3FD50007B1A60 /* CharacterDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterDetailView.swift; sourceTree = "<group>"; };
17CAB4F926A824470048F2F1 /* CharacterCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterCell.swift; sourceTree = "<group>"; };
17F1E38526A1AF6A009C1CDB /* Character.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Character.swift; sourceTree = "<group>"; };
17F1E38C26A1DCF0009C1CDB /* Data.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -83,6 +85,7 @@
17CAB4F926A824470048F2F1 /* CharacterCell.swift */,
1711B39B26B16D6200BE935B /* CharactersView.swift */,
1711B39D26B1898100BE935B /* ContentView.swift */,
171752C026B3FD50007B1A60 /* CharacterDetailView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down
36 changes: 36 additions & 0 deletions Rick-and-Morty/Rick And Morty/Views/CharacterDetailView.swift
Original file line number Diff line number Diff line change
@@ -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])
}
}

0 comments on commit 94b8c64

Please sign in to comment.