Come back again.
So far everything we did in animation we did on a frame of an object we changed a center we changed
the beat or the height.
But this time now we wanted the animation on an object that has kind of strengths essentially animating
in auto layout is actually very simple.
So let me show you how we do not want to go to school and I'm going to start a new app called animating
in a short for today.
I'm just making things up right now.
So here is what I'm going to have is this I'm going to go ahead into my main storyboard and yet I'm
going to have a box that's have a wide view which is already there and this box is going to be like
this very is that's perfectly fine.
I'm going to make it a little bit more distinctive such as that.
And then I'm going to say let's have a top a space constraint a left or a leading space right or a trailing
a space as well as a height constant.
So now let's go to something and in here I want to have two outlets on this is probably the first time
we have done it like this but you will see how we do it.
The first one is going to be that you are viewing with a red box of the type you view outlet connect.
And the second one is going to be my constraints.
I want to change my height constraint so I want to hold the control like it over here and say this is
an outlet of the type in its layout constraint and I'm going to call it height comes trains and now
I have both of them in my street fight.
So the school backs while programming in and I'm going to go ahead and say that's the leadout Let's
get some space.
I don't need any of that.
I'm going to say and touches it.
So that's what I want to run the animation and what I say at touches and do something very simple say
Hi it's kind of strange dot Konstantinov do you all want to say other much larger number let's say 400
and then now that I have said that I have to run and I have to animate it and if you remember if we
do that way saying lay out needed or lay out if needed.
And I'm going to say do that in your view Dauth animate Vitt the creation of say two seconds and the
animation that they want to have is this I want to say so thought of you that lay out if needed.
So I lay out the objects if they need to be laid out again.
So let's go ahead and see how that plays out if it all works.
Every time I had that touches and that the height of this object should be set to 400 at the height
of the constraint.
And then based on that the red box should animate itself in two seconds trick.
And that's what's happening for presses again.
Obviously we're not going to see anything because it is still 400 and the layout is really laying out
the view but nothing is actually happening.
So that's a very basic animation of our constraints.
Almost everything works similarly.
The only thing you want to keep in mind is voile in a frame based animation or a view based animation.
We set the values within the body of the view any made in here we set them outside and within the body
of the animate we say to lay them out.
So whatever reason US value is going to be laid out in here.
And that's about that.
And let's move on to our next lesson.