Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Island SwiftUI Animations

How can I implement swiftUI animations on a dynamic island icon? I want to do this:

DynamicIsland() { ... } 
compactLeading: {
  Image("my-icon").shineEffect()
} compactTrailing: {
  Image("my-icon")
} 

Where in shine effect I start the animation on onAppear:

func body(content: Content) -> some View {
  content
    .onAppear() { 
      startAnimation()
    }
}

In the main app it works, but in the dynamic island it doesn't.

like image 684
annaoomph Avatar asked Oct 18 '25 06:10

annaoomph


1 Answers

The documentation explicitly states that standard animations don‘t work. You can only animate content-state update using

built-in transitions: opacity, move(edge:), slide, push(from:), or combinations of them. Additionally, request animations for timer text with numericText(countsDown:).

like image 66
fruitcoder Avatar answered Oct 19 '25 20:10

fruitcoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!