1
00:00:00,570 --> 00:00:01,460
Come back again.

2
00:00:01,470 --> 00:00:07,830
So far everything we did in animation we did on a frame of an object we changed a center we changed

3
00:00:07,830 --> 00:00:09,110
the beat or the height.

4
00:00:09,270 --> 00:00:15,030
But this time now we wanted the animation on an object that has kind of strengths essentially animating

5
00:00:15,060 --> 00:00:17,860
in auto layout is actually very simple.

6
00:00:17,880 --> 00:00:24,210
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

7
00:00:24,300 --> 00:00:27,520
in a short for today.

8
00:00:27,780 --> 00:00:29,900
I'm just making things up right now.

9
00:00:30,300 --> 00:00:35,340
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

10
00:00:35,340 --> 00:00:42,420
going to have a box that's have a wide view which is already there and this box is going to be like

11
00:00:42,420 --> 00:00:44,680
this very is that's perfectly fine.

12
00:00:44,940 --> 00:00:49,580
I'm going to make it a little bit more distinctive such as that.

13
00:00:50,100 --> 00:00:59,400
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

14
00:00:59,400 --> 00:01:02,180
a space as well as a height constant.

15
00:01:02,370 --> 00:01:10,480
So now let's go to something and in here I want to have two outlets on this is probably the first time

16
00:01:10,500 --> 00:01:13,530
we have done it like this but you will see how we do it.

17
00:01:13,590 --> 00:01:21,260
The first one is going to be that you are viewing with a red box of the type you view outlet connect.

18
00:01:21,480 --> 00:01:24,970
And the second one is going to be my constraints.

19
00:01:24,990 --> 00:01:30,750
I want to change my height constraint so I want to hold the control like it over here and say this is

20
00:01:30,750 --> 00:01:38,550
an outlet of the type in its layout constraint and I'm going to call it height comes trains and now

21
00:01:38,640 --> 00:01:41,700
I have both of them in my street fight.

22
00:01:41,790 --> 00:01:48,450
So the school backs while programming in and I'm going to go ahead and say that's the leadout Let's

23
00:01:48,450 --> 00:01:49,620
get some space.

24
00:01:49,710 --> 00:01:51,110
I don't need any of that.

25
00:01:51,180 --> 00:01:53,720
I'm going to say and touches it.

26
00:01:53,790 --> 00:01:59,740
So that's what I want to run the animation and what I say at touches and do something very simple say

27
00:01:59,760 --> 00:02:07,180
Hi it's kind of strange dot Konstantinov do you all want to say other much larger number let's say 400

28
00:02:08,040 --> 00:02:13,560
and then now that I have said that I have to run and I have to animate it and if you remember if we

29
00:02:13,560 --> 00:02:18,680
do that way saying lay out needed or lay out if needed.

30
00:02:18,780 --> 00:02:26,610
And I'm going to say do that in your view Dauth animate Vitt the creation of say two seconds and the

31
00:02:26,610 --> 00:02:34,590
animation that they want to have is this I want to say so thought of you that lay out if needed.

32
00:02:34,740 --> 00:02:39,510
So I lay out the objects if they need to be laid out again.

33
00:02:39,520 --> 00:02:42,640
So let's go ahead and see how that plays out if it all works.

34
00:02:42,660 --> 00:02:48,570
Every time I had that touches and that the height of this object should be set to 400 at the height

35
00:02:48,570 --> 00:02:49,620
of the constraint.

36
00:02:49,740 --> 00:02:55,620
And then based on that the red box should animate itself in two seconds trick.

37
00:02:55,740 --> 00:02:58,370
And that's what's happening for presses again.

38
00:02:58,380 --> 00:03:04,290
Obviously we're not going to see anything because it is still 400 and the layout is really laying out

39
00:03:04,290 --> 00:03:06,590
the view but nothing is actually happening.

40
00:03:06,870 --> 00:03:10,820
So that's a very basic animation of our constraints.

41
00:03:10,920 --> 00:03:12,780
Almost everything works similarly.

42
00:03:12,810 --> 00:03:19,650
The only thing you want to keep in mind is voile in a frame based animation or a view based animation.

43
00:03:19,650 --> 00:03:27,360
We set the values within the body of the view any made in here we set them outside and within the body

44
00:03:27,360 --> 00:03:29,600
of the animate we say to lay them out.

45
00:03:29,790 --> 00:03:34,230
So whatever reason US value is going to be laid out in here.

46
00:03:34,520 --> 00:03:35,600
And that's about that.

47
00:03:35,620 --> 00:03:37,070
And let's move on to our next lesson.
