New in SwiftUI 3: SwiftUI 3 Animation in iOS 15

Sep 28, 2021 · 3 min read

Like everything else in SwiftUI, attaching animation to your view is as easy as eating cake 😋. SwiftUI 3 brings more control over how animations are applied to the views.

New syntax:

@inlinable public func animation<V>(_ animation: Animation?, value: V) -> some View where V : Equatable

Omitting value parameter in SwiftUI doesn’t throw error yet but you get deprecation warning:

'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead.