Comments (2)
Able to solve by adding extension for View to pass empty params for redacted, if condition is true view will be redacted and if false it would add skeletons for that view.
(Background: .redacted will add skeleton views for all subviews within particular view, more info https://www.avanderlee.com/swiftui/redacted-view-modifier/
)
extension View { @ViewBuilder func redacted(if condition: @autoclosure () -> Bool) -> some View { redacted(reason: condition() ? .placeholder : []) } }
Example:
.redacted(if: myState == .loading)
.shimmering(active: myState == .loading)
from swiftui-shimmer.
I have debugged a bit, and the reason is:
when we apply redacted along with Shimmering, after stopping shimmering the shimmer view stays there.
from swiftui-shimmer.
Related Issues (13)
- Effect is not working with refreshable modifier HOT 1
- Shimmer not working on XCode 15.0 beta with iOS 17.0 HOT 7
- Conditional ViewModifier issue
- I cannot run M1 HOT 1
- View moves downwards when applying basic shimmer HOT 13
- Spikes CPU and leads to a crash on iOS 17 HOT 1
- Not working anymore on iOS 17 + memory leak HOT 2
- iOS 17 Memory Spike HOT 1
- Animation bug HOT 2
- High CPU load even if hidden HOT 1
- Can we have fix for this issue to make this compilable for Xcode 14, Swift 5.7 HOT 1
- Feature Request: Add support for CocoaPods HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftui-shimmer.