Post

Replies

Boosts

Views

Activity

Even slight main thread congestion causes Alert to miss dismissals
One frequent but hard to reproduce bug in SwiftUI is being unable to dismiss a basic Alert. I think I've managed to reproduce the issue here. If there is even a little congestion in the main thread, here in the form of a counter the updates every 0.1 seconds, the Alert will fail to dismiss 90% of the time. This level of activity should be nothing remarkable. It will dismiss sometimes but usually does not. See attached project. Sample project for Alert bug Feedback case: https://feedbackassistant.apple.com/feedback/14719229
Topic: UI Frameworks SubTopic: SwiftUI
4
0
543
Aug ’24
NavigationStack usage adding unwanted position animation
Several buttons with no position animations on them will begin to move around when placed inside a NavigationStack. If you comment out the NavigationStack the buttons will remain still and only the desired glow animation will occur. Also this only seems to occur when the button animation toggles based on a @Published Bool, not with a @State Bool Demonstration code
Topic: UI Frameworks SubTopic: SwiftUI
2
0
447
Aug ’24
is tab key functionality meant to be working in SwiftUI?
I'm trying to get my app to function like the iOS Contacts app where either the Tab key or the Enter key can be used to progress from field to field. I have things working for the Enter key by changing the FocusState when onSubmit is called, but this doesn't work for the Tab key. This isn't anything to do with system settings since iOS Contacts works as expected. How am I supposed to listen for the tab key in iOS to change the focus?
0
0
603
Oct ’22
What if they tap the submit button instead of hitting Done or Enter?
For https://developer.apple.com/videos/play/wwdc2021/10023/?time=411 I have a similar case in my app, but SwiftUI doesn't seem to be able to sanely handle the case where the user hits the submit button after typing instead of hitting Return or the "Done" button like they do in the video. In my case I have a focus listener on the Textfield and want to perform a custom action when the Textfield loses focus. If they manually hit the submit button in the UI instead of using the keyboard, the textfield doesn't lose focus or at least the handler isn't called. Is there some way to make sure that the lose focus handler is called on the text field when they tap the submit without a bunch of kludgey code creating dependencies between the components?
0
0
1k
Sep ’22
Even slight main thread congestion causes Alert to miss dismissals
One frequent but hard to reproduce bug in SwiftUI is being unable to dismiss a basic Alert. I think I've managed to reproduce the issue here. If there is even a little congestion in the main thread, here in the form of a counter the updates every 0.1 seconds, the Alert will fail to dismiss 90% of the time. This level of activity should be nothing remarkable. It will dismiss sometimes but usually does not. See attached project. Sample project for Alert bug Feedback case: https://feedbackassistant.apple.com/feedback/14719229
Topic: UI Frameworks SubTopic: SwiftUI
Replies
4
Boosts
0
Views
543
Activity
Aug ’24
NavigationStack usage adding unwanted position animation
Several buttons with no position animations on them will begin to move around when placed inside a NavigationStack. If you comment out the NavigationStack the buttons will remain still and only the desired glow animation will occur. Also this only seems to occur when the button animation toggles based on a @Published Bool, not with a @State Bool Demonstration code
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
447
Activity
Aug ’24
is tab key functionality meant to be working in SwiftUI?
I'm trying to get my app to function like the iOS Contacts app where either the Tab key or the Enter key can be used to progress from field to field. I have things working for the Enter key by changing the FocusState when onSubmit is called, but this doesn't work for the Tab key. This isn't anything to do with system settings since iOS Contacts works as expected. How am I supposed to listen for the tab key in iOS to change the focus?
Replies
0
Boosts
0
Views
603
Activity
Oct ’22
What if they tap the submit button instead of hitting Done or Enter?
For https://developer.apple.com/videos/play/wwdc2021/10023/?time=411 I have a similar case in my app, but SwiftUI doesn't seem to be able to sanely handle the case where the user hits the submit button after typing instead of hitting Return or the "Done" button like they do in the video. In my case I have a focus listener on the Textfield and want to perform a custom action when the Textfield loses focus. If they manually hit the submit button in the UI instead of using the keyboard, the textfield doesn't lose focus or at least the handler isn't called. Is there some way to make sure that the lose focus handler is called on the text field when they tap the submit without a bunch of kludgey code creating dependencies between the components?
Replies
0
Boosts
0
Views
1k
Activity
Sep ’22