@inlinable public func animation<V>(_ animation: Animation?, value: V) -> some View where V : Equatable
'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead.
@available(iOS, introduced: 13.0, deprecated: 15.0, message: "Use withAnimation or animation(_:value:) instead.")@inlinable public func animation(_ animation: Animation?) -> some View
struct AnimationChanges: View { @State private var offset: CGFloat = 0 @State private var scaleValue: CGFloat = 1 var body: some View { VStack { Text("DevTechie") .font(.largeTitle) .offset(x: offset) .scaleEffect(scaleValue) .animation(.easeInOut(duration: 5)) Spacer() HStack { Spacer() Button("Change Offset") { offset += 100 } Spacer() Button("Change Scale") { scaleValue += 1 } Spacer() } } } }
struct AnimationChanges: View { @State private var offset: CGFloat = 0 @State private var scaleValue: CGFloat = 1 var body: some View { VStack { Text("DevTechie") .font(.largeTitle) .scaleEffect(scaleValue) .offset(x: offset) .animation(.easeInOut(duration: 5), value: scaleValue) Spacer() HStack { Spacer() Button("Change Offset") { offset += 100 } Spacer() Button("Change Scale") { scaleValue += 1 } Spacer() } } } }
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)extension View {@inlinable public func animation<V>(_ animation: Animation?, value: V) -> some View where V : Equatable}