(OLD) Adding a segmented control for tip percentages – WeSplit SwiftUI Tutorial 9/10

preview_player
Показать описание
In this project we build a check-sharing app using SwiftUI.

Рекомендации по теме
Комментарии
Автор

Questions? Comments? Tweet me @twostraws

twostraws
Автор

2:55 why is the "Tip percentage" text on line 35 not displayed anywhere in the UI? What it is for?

PetersFXfilms
Автор

I know that "self." is used to reference itsself. But why is it needed in the picker when displaying the amount. The code still works without it i.e. "tipPercentage[%0]"

Soaayy
Автор

In the latest version of swift the text inside of the Section is capitalized. To have the text appear as you wrote it in xcode, the Text field should have the option ".textCase(.none)" appended to it. So it should look like this:

Section(header: Text("How much of a tip do you want to leave?").textCase(.none)){
// Other code goes here
}

octaviusbytes
Автор

I cannot use $tip_percentage inside the Segmented Picker. Xcode returns error “use of unresolved identifier... I tried many times

asganawayaway
Автор

Thanks Paul. One question: with identical code to yours, the section header on my Xcode creates “HOW MUCH TIP...” in all caps whereas yours is as you wrote it in code. I am using Xcode 12.0 beta, which may explain things, I don’t know. Is there a way to force section headers to display as written rather than capitalising the text?

rhaydon
Автор

Hey Paul! Thanks for your courses and amazing videos! Any idea how to use an enum with pickers as the SelectionValue? I have tried with an enum implementing Identifiable, Hashable protocols but it doesn’t work :(

MathieuVANDEGINSTE
Автор

Are Main Menus a thing of the past with SwiftUI?

jennywallace
Автор

sir, how to show selected option from dropdwon menu?

bhuvaneswarikittappa
Автор

Why do you use $0? that wasn't really clreaified or I'm too daft to understand

noamif