In the ScoreKeeper tutorial there's the following code:
ForEach($players) { $player in
GridRow {
TextField("Name", text: $player.name)
Text("\(player.score)")
Stepper("\(player.score)", value: $player.score)
.labelsHidden()
}
}
Can someone please explain why the 2 instances of "player.score" are not preceded by "$". Thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
I've got a situation where I want the iPad to push an editing view onto the sidebar (like on iPhone) and also display a detail view (no content view). This is working great.
However, I need to determine which item from a List in a NavigationSplitView has been selected and pass this to the detail view (the selection is out of scope).
This works with the List selection parameter, but the item selected is ONLY selected and the child view in the NavigationLink does not get pushed, nor does the detail view get changed.
I either need to figure out a way to capture the selection without the List Selection parameter (Tap Gesture?) or get the navigation to happen even when using the Selection parameter.
I'd appreciate some ideas as I'm a newb just learning SwiftUI.
Topic:
UI Frameworks
SubTopic:
SwiftUI