Skip to content

Conversation

@blu-Fox
Copy link

@blu-Fox blu-Fox commented Apr 1, 2025

Hi, thanks for the very nice particles demo.

As a thank you, here are some quick improvements to it. 😊

  • Fixed Timer interfering with Picker. This is a SwiftUI bug. It can be prevented by extracting the Picker into a separate View.
  • Simplified code to update particles. No need to switch over state and have a separate text variable. All can be driven by a single state variable.
  • Extracted logic into separate functions. As a result, the body is only several lines of code, and everything is neatly separated.
  • Replaced GeometryReader with onGeometryChange. This is shorter and cleaner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant