Excellent work, we have everything wired up with our button or that we have to do is turn our screen
torch red when we want to turn it on.
So the way we do that is we grab the view.
Now, remember, the button sits on a canvas.
That canvas is called The View.
It backs everything in what you can see in that particular screen.
We can access it in our view controller, because our view controller is linked to that storyboard.
So I can just start typing view.
And there it is, the view that the controller manages.
If you press enter, it loads it for you.
Now what about the view?
Do we want to change?
If you put a dot and start typing back ground color, this is where you change it.
Press enter.
Equal to now, the way we get colors in iOS, there are several ways we can define them as red, green,
blue or hex colors, or I forget the other systems, but there's a really easy way, and that is to
call user interface color.
Dot, and then you have a whole list of the various colors, so first green torch, we want red.
Well, it's an astronomy torch, so let's have it now if we play this.
Check this out.
Are we loaded up, yes, button and bang, the view goes red.
Now if I press the button again, nothing happens because all it's doing is setting that red every every
time.
So I'm going to set you just a little bit of homework here.
I would like you to think about how you change this item into an if else statement that flips between
red and white for the screen torch.
Pretty simple.
Have a good go at it before I show you the solution.