Animation Curves and Animation Timing in SwiftUI | Bootcamp #26

Animation Curves and Animation Timing in SwiftUI | Bootcamp #26

Swiftful Thinking

3 года назад

19,153 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Paul Williams
Paul Williams - 28.07.2023 05:58

In order for .animation to work after iOS 15.0, a @State boolean variable has to be declared and toggled when the button is pressed. Next the .animation(Animation.action) will change to .animation(Animation.action, value: "@State variable"). Here's an example:

@State var isAnimating: Bool = false
@State var showAnimation: Bool = false

var body: some View {
VStack {
Button("Button) {
isAnimating.toggle()
showAnimation.toggle()
}
RoundedRectangle(cornerRadius: 20)
.frame(width: isAnimation ? 350 : 50, height: 100)
.animation(Animation.linear, value: showAnimation)
}
}

This should get rid of the warning.

Ответить
Jason Eyermann
Jason Eyermann - 28.05.2023 10:07

It says .animation is now deprecated and we need to use withanimation which is simple enough but it says we can also use .animation(value: xxx) but i think the value just links to the var so it’s the same as withanimation.

Ответить
olivier geiger
olivier geiger - 29.03.2023 10:56

I always learn new concepts after every video I watch. You really are the best teacher

Ответить
Hesham Abdo
Hesham Abdo - 23.11.2022 22:14

Great video

Ответить
maged mohmed
maged mohmed - 20.09.2022 21:57

Thank you Nick for your helpful tutorial , really iam in progress and that return to you 🤎🤎

Ответить
Skyy Moore
Skyy Moore - 27.08.2022 07:20

Yes! Keep it simple stupid. I love that you build up the language step by step. A lot of other people try to convey too much too fast.

Ответить
Nat Genesis
Nat Genesis - 26.08.2022 17:38

Thanks so much Big Bro

Ответить
Kurt Schmucker
Kurt Schmucker - 11.04.2022 18:21

Starting each video with essentially a "blank" file is a great approach. Thanks for doing so.

Ответить
Mehrad T
Mehrad T - 18.01.2022 03:08

Great Video!

Ответить
bbulliard
bbulliard - 28.11.2021 16:49

Wonderful video. Thank you

Ответить
Tali Hutchinson-West
Tali Hutchinson-West - 27.09.2021 10:57

Thanks Nick! This course is getting better and better!!!

Ответить
Palestine EStorm
Palestine EStorm - 24.09.2021 09:01

Does anyone know what blendDuration does?

Ответить
Raj Kumar
Raj Kumar - 15.07.2021 11:56

All your videos are awesome, it’s exactly what i was looking for, thanks for your help Nick

Ответить
pitmanra
pitmanra - 20.03.2021 19:54

Very cool timing demonstration.

Ответить