Posts

Post not yet marked as solved
1 Replies
213 Views
I was nearly finished with my SwiftUI/Combine application and everything was working correctly via simulation. However, upon using a device, I noticed the presented Views don't display within their own ZStack Layer when running on any device. That is, I get a blank white screen when running the code on a device. Why the difference with the same code? Is this a Screen-Builder flaw (code is large) and if so, why only on a device but not via simulator? I don't have an active (purchased) developer membership.
Posted
by UncleRic.
Last updated
.
Post not yet marked as solved
2 Replies
913 Views
Scenario:User selects a static item from a Picker which is stored into a $State variable.Desired feature:A function (e.g. doSomething( ) ) is fired EVERY TIME the Picker is used or whenever the $State variable has changed.@State private var currentChoice = 0 { didSet { doSomething() } } ... Picker("Weapon", selection: $currentChoice) { ForEach(0 ..< moves.count) { Text("\(self.moves[$0])") } }.pickerStyle(SegmentedPickerStyle())Question: What's the correct declarative/SwiftUI/Combine paradigm to use?Do I have to make Picker a publisher?How is that done in this particular scenario?
Posted
by UncleRic.
Last updated
.