Skip to content

Commit 34bbb40

Browse files
author
Tim
committed
iOS 17 Animation fixed
1 parent 0fe0817 commit 34bbb40

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/SkeletonUI/Modifiers/SkeletonModifier.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ import Combine
33

44
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
55
public struct SkeletonModifier: ViewModifier {
6+
@State private var phase: CGFloat = 0
67
let shape: ShapeType
78
let animation: AnimationType
89
let appearance: AppearanceType
910
@State var animate: Bool = false
1011

1112
public func body(content: Content) -> some View {
1213
content
13-
.modifier(SkeletonAnimatableModifier(CGFloat(integerLiteral: Int(truncating: animate as NSNumber)), appearance).animation(animation.type))
14+
.modifier(SkeletonAnimatableModifier(phase, appearance))
1415
.clipShape(SkeletonShape(shape))
15-
.onAppear { animate.toggle() }
16+
.animation(animation.type, value: phase)
17+
.onAppear {
18+
phase = 1
19+
}
1620
}
1721
}

0 commit comments

Comments
 (0)