Комментарии:
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.
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.
ОтветитьI always learn new concepts after every video I watch. You really are the best teacher
ОтветитьThank you Nick for your helpful tutorial , really iam in progress and that return to you 🤎🤎
Ответить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.
ОтветитьThanks so much Big Bro
ОтветитьStarting each video with essentially a "blank" file is a great approach. Thanks for doing so.
ОтветитьGreat Video!
ОтветитьWonderful video. Thank you
ОтветитьThanks Nick! This course is getting better and better!!!
ОтветитьDoes anyone know what blendDuration does?
ОтветитьAll your videos are awesome, it’s exactly what i was looking for, thanks for your help Nick
ОтветитьVery cool timing demonstration.
Ответить