Post

Replies

Boosts

Views

Activity

Comment on ScrollViewProxy scrollTo in onAppear may cause state changes to be lost
Your answer and description of onAppear raises a few questions. Please note that the problem I described did not refer to the fact that no scrolling process may be triggered. This part works in the demo code and is not the actual issue. The main problem is that the change of state1 back to false in the defer code block does not update the view accordingly. This does not happen if you remove the scrollTo call in the onAppear method. Do you have an explanation for this?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’24
Comment on Xcode 16 no longer sets ENABLE_PREVIEWS=YES for preview builds
A solution that would solve at least part of the problem described with regard to exclusive code for SwiftUI previews: Give us a way to annotate code so that it can only be used within #Preview macros. I.e. sth. that prevents this code from "accidentally" being used in regular / production builds.
Replies
Boosts
Views
Activity
Nov ’24
Comment on ScrollViewProxy scrollTo in onAppear may cause state changes to be lost
Your answer and description of onAppear raises a few questions. Please note that the problem I described did not refer to the fact that no scrolling process may be triggered. This part works in the demo code and is not the actual issue. The main problem is that the change of state1 back to false in the defer code block does not update the view accordingly. This does not happen if you remove the scrollTo call in the onAppear method. Do you have an explanation for this?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24