1
00:00:00,540 --> 00:00:06,960
To come back again this lesson is called Philip back or forth because I think Zakat does that depending

2
00:00:06,960 --> 00:00:09,010
on the result of the comparison.

3
00:00:09,070 --> 00:00:15,910
Besides it has to flip to ties back to what they used to be or forward to showing us the mind.

4
00:00:16,080 --> 00:00:23,340
So I don't see how we are going to do that when I go to school and I went to I told you us one of them

5
00:00:23,340 --> 00:00:27,510
is going to be called View Controller.

6
00:00:27,570 --> 00:00:34,290
Plus flip to smile when I copy this whole thing because I'm going to make another one very similar to

7
00:00:34,290 --> 00:00:41,030
it and this one is going to be called Flip back.

8
00:00:41,340 --> 00:00:43,750
So one of them is going to flip to a smile.

9
00:00:43,830 --> 00:00:47,140
The other one is going to flip back to whatever it used to be.

10
00:00:47,160 --> 00:00:50,680
So let's see how we're going to do that for both of them.

11
00:00:50,700 --> 00:00:57,510
I need to import the UI kit I need to say this is an extension of view controller and this is the body

12
00:00:57,510 --> 00:00:57,830
of it.

13
00:00:57,840 --> 00:01:00,730
So I'm going to copy that to both of these fights.

14
00:01:00,860 --> 00:01:07,290
And now in the flip back I'm going to write a code that actually makes a transition and flips us back

15
00:01:07,290 --> 00:01:14,100
to the question like so I could write everything or I could just copy everything from Flip to reveal

16
00:01:14,130 --> 00:01:16,080
because it's very similar to this one.

17
00:01:16,200 --> 00:01:22,830
So I'm going to copy this entire function go to flip back and say in here.

18
00:01:23,100 --> 00:01:26,380
Phillip Bakhash is the name of the function.

19
00:01:26,550 --> 00:01:31,870
It takes in a label uses that label in half a second.

20
00:01:32,130 --> 00:01:38,070
And in animation that if it was from left before this time it becomes from right.

21
00:01:38,070 --> 00:01:44,320
So it flips to the other side and changes the background color to dark gray.

22
00:01:44,370 --> 00:01:53,390
What we used to have at the beginning and changes that tied to the value of my label the question mark.

23
00:01:53,580 --> 00:01:57,960
So that is the flip back is going to go back to what it used to be.

24
00:01:57,960 --> 00:02:04,450
Let me copy this whole thing once again and go to flip to a smile and the flipper smile.

25
00:02:04,470 --> 00:02:13,710
This is called Flip to smile and the flip to smile takes same put time in half a second and makes the

26
00:02:13,710 --> 00:02:17,370
transition from left again and you will see why.

27
00:02:17,370 --> 00:02:23,670
Because I want the rotation to be in the same direction it goes that makes the background color become

28
00:02:24,030 --> 00:02:31,000
maybe purple purple and then it makes it look like a smile.

29
00:02:31,910 --> 00:02:32,940
And that's about that.

30
00:02:33,020 --> 00:02:35,510
So let's see how we use these two.

31
00:02:35,510 --> 00:02:38,020
Flipping back and flipping to a smile.

32
00:02:38,240 --> 00:02:44,680
If I could might compare and if I find the same ones I don't need to print anything I need to do this

33
00:02:44,690 --> 00:02:57,410
I need to say if you found the correct two tiles flip to a smile of the first tile on that flip to smile

34
00:02:57,650 --> 00:03:02,630
second time so they Bosko to show us the smile because they are the same.

35
00:03:02,630 --> 00:03:04,200
I don't need that.

36
00:03:04,250 --> 00:03:10,160
Of course if it wasn't the case if they were different they have to flip them back for both of them

37
00:03:10,430 --> 00:03:21,240
first hand flicked back the second and let's right now and once it comes up you should be able to see

38
00:03:21,240 --> 00:03:27,990
that two times flipping to show us the right values and then they should show us depending on what their

39
00:03:27,990 --> 00:03:28,960
status is.

40
00:03:28,970 --> 00:03:35,650
I do have a question mark again or they should show us the smiley face six and three.

41
00:03:35,660 --> 00:03:36,480
They are not the same.

42
00:03:36,480 --> 00:03:43,750
They go back to question Mike 4 and 0 are not the same but 0 1 0 are the same.

43
00:03:43,980 --> 00:03:50,940
Now the colors I think they kind of made a mistake because I intended for the success to be green and

44
00:03:51,060 --> 00:03:54,270
somebody in between to be orange or purple or something.

45
00:03:54,360 --> 00:03:56,710
But that's something you can easily fix it yourself.

46
00:03:56,710 --> 00:04:01,440
So right now then we top it becomes green and Auburn becomes green as well.

47
00:04:01,440 --> 00:04:02,830
And if they're not the same.

48
00:04:02,830 --> 00:04:04,400
They turned out great.

49
00:04:04,620 --> 00:04:07,220
If they are the same they turned into purple.

50
00:04:07,230 --> 00:04:10,270
Let me fix that because that's going to stick with me.

51
00:04:10,290 --> 00:04:14,990
I don't want them to show up as green if they are not found yet.

52
00:04:15,090 --> 00:04:18,000
So I'm going to go ahead to my two flips.

53
00:04:18,060 --> 00:04:20,130
One of them is called Flip to reveal.

54
00:04:20,490 --> 00:04:27,240
Say in that case make it orange color because orange represent something that hasn't really happened

55
00:04:27,240 --> 00:04:27,530
yet.

56
00:04:27,540 --> 00:04:33,090
So it's it's in danger and it's the threat of being the right one or not and then I'm going to go to

57
00:04:33,090 --> 00:04:36,310
rebuild and compare and say do the same thing.

58
00:04:36,570 --> 00:04:43,620
Orange and now it's raining again and we should be able to see a better representation of of the colors

59
00:04:43,620 --> 00:04:44,030
now.

60
00:04:44,220 --> 00:04:48,380
So here that is orange.

61
00:04:48,400 --> 00:04:58,640
And to one day go back 0 and 3 and 4 and 2 and 2 and 2 and we get the right one.

62
00:04:58,670 --> 00:05:02,480
And as you can see when I tap something it turns to the right.

63
00:05:02,560 --> 00:05:07,760
And then again they go back to flipping reverses itself.

64
00:05:07,900 --> 00:05:13,730
But then we find the similar ones which I think one of these was zero or I'm wrong about it.

65
00:05:13,920 --> 00:05:15,750
So let me find one that is similar.

66
00:05:15,850 --> 00:05:18,450
Six on four five.

67
00:05:18,450 --> 00:05:19,270
This was five.

68
00:05:19,270 --> 00:05:19,920
Right.

69
00:05:19,930 --> 00:05:24,670
And when they are on the right side they flip to the right direction as if they flip one more time in

70
00:05:24,670 --> 00:05:28,170
the same direction and that's exactly what they wanted to see.

71
00:05:28,330 --> 00:05:35,440
So why now we have managed to have a flip to a smile that takes us to be a smiley face on a flip back

72
00:05:35,440 --> 00:05:40,720
which is going to take us back to where we used to be and we used that within the body of our compare

73
00:05:40,720 --> 00:05:41,710
function.

74
00:05:41,710 --> 00:05:43,350
We don't need to print anything there.

75
00:05:43,360 --> 00:05:45,150
We don't need to print anything here.

76
00:05:45,250 --> 00:05:48,180
We just need to do the actual flip part.

77
00:05:48,220 --> 00:05:54,070
So let's keep it up to here and move on to our next lesson so let's keep it up to a year and move on

78
00:05:54,070 --> 00:05:55,420
to our next lesson.
