Skip to content

Commit 9fd63ec

Browse files
committed
FIX: layer layout animation at start (Juanpe#549)
1 parent 5699404 commit 9fd63ec

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+SkeletonView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ private extension UIView {
105105
}) { subview in
106106
subview.recursiveShowSkeleton(skeletonConfig: config)
107107
}
108-
108+
layoutSkeletonIfNeeded()
109+
109110
if let root = root {
110111
_flowDelegate?.didShowSkeletons(rootView: root)
111112
}
@@ -126,7 +127,8 @@ private extension UIView {
126127
}) { subview in
127128
subview.recursiveUpdateSkeleton(skeletonConfig: config)
128129
}
129-
130+
layoutSkeletonIfNeeded()
131+
130132
if let root = root {
131133
_flowDelegate?.didUpdateSkeletons(rootView: root)
132134
}

SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+Transitions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import UIKit
55
extension UIView {
66

77
func startTransition(transitionBlock: @escaping () -> Void) {
8+
layoutIfNeeded()
9+
810
guard let transitionStyle = _currentSkeletonConfig?.transition,
911
transitionStyle != .none else {
1012
transitionBlock()

0 commit comments

Comments
 (0)