I was trying to solve Day 24 challenges.
Create a custom ViewModifier (and accompanying View extension) that makes a view have a large, blue font suitable for prominent titles in a view. - solved
"""
struct Title: ViewModifier {
func body(content: Content) -> some View {
content
.font(.largeTitle)
.foregroundColor(.blue)
}
}
extension View{
func titlestyle1() -> some View {
self.modifier(Title())
}
}
"""
Go back to project 1 and use a conditional modifier to change the total amount text view to red if the user selects a 0% tip.
-- I know paul said we cannot use If statements and frankly I dunno how to use it in the section where I am displaying the Total Amount for the check before dividing between all the participants.
I know that I capture Tipselections in the above method but I guess where I am stuck is to use this tip selection value and compare it with 0 so I can conditionally use to change the font. apprectiate any hints :)
Go back to project 2 and create a FlagImage() view that renders one flag image using the specific set of modifiers we had.
--> I am a little confused with the question.. Is paul asking us to to create a view that will only change the flag image of only 1 flag ? or create a general view modifier when applied will change for all the flags ?
appreciate your help !