SwiftUI’s `refreshable` closure captures `self` only once
It appears that refreshable closure captures copy of self
dead tight on first View
initialization and never recreates itself on body
invocations.
How to pass an enviromentObject to a UIViewRepresentable’s Coordinator?
I would like to pass an environment object to a UIViewRepresentable
like this:
NavigationLink in ScrollView doesn’t handle or display like it does in a List
I’ve found that both List
and Form
are too limited for my needs, so I’m forced to build a traditional looking UI in a ScrollView
.
Loading Indicators in SwiftUI causing infinite renders
I have a loading indicator class that is utilized in all view models, what I’m trying to do is to track each API’s loading state independently rather than having one loading flag for the entire VM.
SwiftUI: withAnimation in parent view results in animation in child view
This code presents a grid of buttons in a sheet and updates the parent view’s view model and view. Touching a grid button always redraws the sheet’s view even though its state doesn’t (shouldn’t?) change, and with animation even though none is configured in the sheet’s view. This code is complete, and I tested on real device.
Making top of navigationBar view transparent when scrolling through a List view [duplicate]
This question already has answers here: Make SwiftUI navigation bar transparent (5 answers) Closed 4 days ago. In my app I’m using a List() view to display a series of buttons as seen in the pictures below. When first opening the view (which lies within a NavigationStack{} view) everything looks fine (Picture 1), but the […]
SwiftUI hierarchical table – how to control which column contains expander arrows
I have a SwiftUI macOS hierarchical table with ‘children’ initializer argument. Everything is working fine but I’d like to have expander arrows in different column. TableColumn definition order doesn’t seem to have any effect nor has the order of properties in the model.
Is there a way how to define which column should contain expander arrows?
Is it possible to have multiple NavigationLinks per row in a List SwiftUI?
I can’t use multiple NavigationLinks in the same row of a List.
SwiftUI onSubmit makes instance unable to deallocate
When accessing view’s @State
or @Binding
from onSubmit
closure, it makes view unable to deinit. Basic example: we have a button and it switches condition to show target view with onSubmit
modifier or not. So, tapping button many times gives us following diagnostics:
Dismiss keyboard in ios17
I am having trouble getting the keyboard to dismiss. When nil it should dismiss but it’s not working so I added the dismiss but that’s also not working. The keyboard flashes but stays. Any suggestions on what I’m missing here. I’m testing on ios17 both in the simulator and on phone and get the same problem: