SwiftGlass icon indicating copy to clipboard operation
SwiftGlass copied to clipboard

2.0 SwiftGlassUI Library

Open 1998code opened this issue 6 months ago • 0 comments

This pull request introduces a new custom Switch component and a Toggle view in the Demo project, providing a visually rich and interactive toggle switch with drag gestures and accent color customization. The changes also include a gradient background for the Toggle view and a preview in dark mode.

New Components and Views:

  • Custom Switch Component: Added a reusable Switch view with drag gesture support, dynamic fill progress, and customizable accent colors. It includes animation for smooth state transitions and gesture handling for toggling between on/off states. ([Demo/Demo/Samples/Essential/Switch.swiftR1-R237](diffhunk://#diff-c6d00cd1533ee11104107fa46a998674756703c939bce9c44f63f5910fca5e84R1-R237))
  • Toggle View: Created a Toggle view showcasing multiple Switch components with various accent colors arranged in a grid layout. Includes a gradient background for visual enhancement. ([Demo/Demo/Samples/Essential/Switch.swiftR1-R237](diffhunk://#diff-c6d00cd1533ee11104107fa46a998674756703c939bce9c44f63f5910fca5e84R1-R237))

Enhancements:

  • Dark Mode Preview: Added a preview for the Toggle view in dark mode using the preferredColorScheme(.dark) modifier. ([Demo/Demo/Samples/Essential/Switch.swiftR1-R237](diffhunk://#diff-c6d00cd1533ee11104107fa46a998674756703c939bce9c44f63f5910fca5e84R1-R237))

1998code avatar Jun 12 '25 11:06 1998code