-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature [RM85] Display Cards #86
Conversation
ViewModel provides characterCardStates
Changed from get to load considering function does not return anything
Provides an episode for an episode url
A character Card is shown for each character from the R and M Api. The RemoteImage view is from stack overflow.
Character Cards are displayed on the app and more are loaded as the user scrolls.
} | ||
|
||
private func getStatusText(character: Character) -> String { | ||
var str = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to avoid names of variables that are not descriptive
import SwiftUI | ||
|
||
final class CharacterCardStateFactory { | ||
private func getStatusColor(character: Character) -> Color { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you consider this to be a private extension on Character status?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be static function
|
||
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just being picky here, but be careful when committing not to add whitespaces
struct CharacterTileView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
Group { | ||
VStack { | ||
CharacterCard(characterCardState: CharacterCardState(id: 2, name: "Morty", image: UIImage(named: "morty-image")!, isAlive: true, species: "Human", lastLocation: "Earth", firstEpisode: "Episode 1")) | ||
CharacterCard(cardViewModel: CharacterCardViewModel(character: Character(id: 1, name: "Morty", species: "Human", lastLocation: LastLocation(name: "Earth", url: ""), status: .alive, imageURL: "", episodeURLs: []))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you're using previews. Have you thought of all the possible display views?
https://github.com/orgs/novoda/projects/1#card-66586128
Character data is shown and more is loaded as the user scrolls.