Closed Gawetaner closed 3 years ago
Hi @Gawetaner, I think it could be a good idea, in order to delay the transition if the developer wants.
I'm going to include it in the backlog. BTW, feel free to create a PR with the changes :)
Hi @Gawetaner, this feature was released :)
Transition Delay
If using SkeletonView for views that are mostly updated quickly, the SkeletonView transition looks like a short flashing of the view.
Example: A view that will be updated with an small amount of data loading from the internet will be updated fast enough to skip the SkeletonView animation and transition. Only if network problems occur, the SkeletonView needs to be shown.
Proposed solution
An optional delay applied to the transition, like the transition duration.
Example: If network problems occur and the update of the view takes longer than the specified delay, the SkeletonView will be shown.
Additional context
I already tried to implement the Delay for the transition, but I didn't find out why 2 transitions are used (https://github.com/Juanpe/SkeletonView/blob/main/Sources/Transitions/UIView%2BTransitions.swift) and when they are used.