markiv / SwiftUI-Shimmer

Shimmer is a super-light modifier that adds a shimmering effect to any SwiftUI View, for example, to show that an operation is in progress. It works well on light and dark modes, and across iOS, macOS, tvOS, watchOS and visionOS.
MIT License
1.04k stars 60 forks source link

[Question] Is it possible to add shimmer behind Button text? #24

Closed day-dreaming-guy closed 1 month ago

day-dreaming-guy commented 5 months ago

I'm trying to make the shimmer work behind the Button text (I had a shimmer class for UIButton, and it was easier as the title and background are separated). I wonder if it's possible to do it for Button as well.

Thank you!

markiv commented 1 month ago

This is now supported since 1.4.2. You can specify a blend mode:

Text("Button Text")
    .shimmering(mode: .background)