Skip to content

Commit

Permalink
feat(GuessTheFlag): add project 3 challenge 2
Browse files Browse the repository at this point in the history
  • Loading branch information
plskz committed Dec 11, 2022
1 parent d39e307 commit 45340a3
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions 03-Guess the Flag/GuessTheFlag/GuessTheFlag/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@

import SwiftUI

// project 3 - challenge 2
struct FlagImage: View {
var country: String

init(of country: String) {
self.country = country
}

var body: some View {
Image(country)
.renderingMode(.original)
.clipShape(RoundedRectangle(cornerRadius: 25))
.shadow(radius: 5)
}
}

struct ContentView: View {
@State private var isShowingScore = false
@State private var isShowingGameOver = false
Expand Down Expand Up @@ -61,10 +77,7 @@ struct ContentView: View {
Button {
flagTapped(number)
} label: {
Image(countries[number])
.renderingMode(.original)
.clipShape(RoundedRectangle(cornerRadius: 25))
.shadow(radius: 5)
FlagImage(of: countries[number]) // project 3 - challenge 2
}
}
}
Expand Down

0 comments on commit 45340a3

Please sign in to comment.