Skip to content

Commit

Permalink
Day 23 Challenge 2: Make tip and total red when tip == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
aranasaurus committed Oct 16, 2019
1 parent adc0c21 commit 32388dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions WeSplit/WeSplit/ContentView.swift
Expand Up @@ -57,11 +57,14 @@ struct ContentView: View {
Text("+ Tip")
Spacer()
Text("$\(tipAmount, specifier: "%.2f")")
.foregroundColor(tipPercentage == 0 ? .red : nil)
}
HStack {
Text("Total")
Spacer()
Text("$\(total, specifier: "%.2f")")
.foregroundColor(tipPercentage == 0 ? .red : nil)
.bold()
}
}

Expand Down

0 comments on commit 32388dd

Please sign in to comment.