To come back again this lesson is called Philip back or forth because I think Zakat does that depending
on the result of the comparison.
Besides it has to flip to ties back to what they used to be or forward to showing us the mind.
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
is going to be called View Controller.
Plus flip to smile when I copy this whole thing because I'm going to make another one very similar to
it and this one is going to be called Flip back.
So one of them is going to flip to a smile.
The other one is going to flip back to whatever it used to be.
So let's see how we're going to do that for both of them.
I need to import the UI kit I need to say this is an extension of view controller and this is the body
of it.
So I'm going to copy that to both of these fights.
And now in the flip back I'm going to write a code that actually makes a transition and flips us back
to the question like so I could write everything or I could just copy everything from Flip to reveal
because it's very similar to this one.
So I'm going to copy this entire function go to flip back and say in here.
Phillip Bakhash is the name of the function.
It takes in a label uses that label in half a second.
And in animation that if it was from left before this time it becomes from right.
So it flips to the other side and changes the background color to dark gray.
What we used to have at the beginning and changes that tied to the value of my label the question mark.
So that is the flip back is going to go back to what it used to be.
Let me copy this whole thing once again and go to flip to a smile and the flipper smile.
This is called Flip to smile and the flip to smile takes same put time in half a second and makes the
transition from left again and you will see why.
Because I want the rotation to be in the same direction it goes that makes the background color become
maybe purple purple and then it makes it look like a smile.
And that's about that.
So let's see how we use these two.
Flipping back and flipping to a smile.
If I could might compare and if I find the same ones I don't need to print anything I need to do this
I need to say if you found the correct two tiles flip to a smile of the first tile on that flip to smile
second time so they Bosko to show us the smile because they are the same.
I don't need that.
Of course if it wasn't the case if they were different they have to flip them back for both of them
first hand flicked back the second and let's right now and once it comes up you should be able to see
that two times flipping to show us the right values and then they should show us depending on what their
status is.
I do have a question mark again or they should show us the smiley face six and three.
They are not the same.
They go back to question Mike 4 and 0 are not the same but 0 1 0 are the same.
Now the colors I think they kind of made a mistake because I intended for the success to be green and
somebody in between to be orange or purple or something.
But that's something you can easily fix it yourself.
So right now then we top it becomes green and Auburn becomes green as well.
And if they're not the same.
They turned out great.
If they are the same they turned into purple.
Let me fix that because that's going to stick with me.
I don't want them to show up as green if they are not found yet.
So I'm going to go ahead to my two flips.
One of them is called Flip to reveal.
Say in that case make it orange color because orange represent something that hasn't really happened
yet.
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
rebuild and compare and say do the same thing.
Orange and now it's raining again and we should be able to see a better representation of of the colors
now.
So here that is orange.
And to one day go back 0 and 3 and 4 and 2 and 2 and 2 and we get the right one.
And as you can see when I tap something it turns to the right.
And then again they go back to flipping reverses itself.
But then we find the similar ones which I think one of these was zero or I'm wrong about it.
So let me find one that is similar.
Six on four five.
This was five.
Right.
And when they are on the right side they flip to the right direction as if they flip one more time in
the same direction and that's exactly what they wanted to see.
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
which is going to take us back to where we used to be and we used that within the body of our compare
function.
We don't need to print anything there.
We don't need to print anything here.
We just need to do the actual flip part.
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
to our next lesson.