1 00:00:00,360 --> 00:00:05,760 Excellent work, we have everything wired up with our button or that we have to do is turn our screen 2 00:00:05,760 --> 00:00:07,880 torch red when we want to turn it on. 3 00:00:08,580 --> 00:00:10,780 So the way we do that is we grab the view. 4 00:00:10,920 --> 00:00:12,900 Now, remember, the button sits on a canvas. 5 00:00:12,900 --> 00:00:15,120 That canvas is called The View. 6 00:00:15,240 --> 00:00:19,850 It backs everything in what you can see in that particular screen. 7 00:00:20,940 --> 00:00:27,480 We can access it in our view controller, because our view controller is linked to that storyboard. 8 00:00:27,810 --> 00:00:29,940 So I can just start typing view. 9 00:00:30,360 --> 00:00:33,600 And there it is, the view that the controller manages. 10 00:00:33,840 --> 00:00:35,650 If you press enter, it loads it for you. 11 00:00:36,300 --> 00:00:37,260 Now what about the view? 12 00:00:37,270 --> 00:00:38,250 Do we want to change? 13 00:00:38,550 --> 00:00:44,140 If you put a dot and start typing back ground color, this is where you change it. 14 00:00:44,310 --> 00:00:45,120 Press enter. 15 00:00:46,170 --> 00:00:51,540 Equal to now, the way we get colors in iOS, there are several ways we can define them as red, green, 16 00:00:51,540 --> 00:00:57,900 blue or hex colors, or I forget the other systems, but there's a really easy way, and that is to 17 00:00:57,900 --> 00:00:59,670 call user interface color. 18 00:01:01,680 --> 00:01:09,520 Dot, and then you have a whole list of the various colors, so first green torch, we want red. 19 00:01:09,660 --> 00:01:13,770 Well, it's an astronomy torch, so let's have it now if we play this. 20 00:01:14,550 --> 00:01:15,470 Check this out. 21 00:01:18,840 --> 00:01:23,420 Are we loaded up, yes, button and bang, the view goes red. 22 00:01:23,780 --> 00:01:30,560 Now if I press the button again, nothing happens because all it's doing is setting that red every every 23 00:01:30,560 --> 00:01:30,820 time. 24 00:01:31,700 --> 00:01:34,510 So I'm going to set you just a little bit of homework here. 25 00:01:35,390 --> 00:01:45,650 I would like you to think about how you change this item into an if else statement that flips between 26 00:01:45,650 --> 00:01:48,910 red and white for the screen torch. 27 00:01:50,180 --> 00:01:50,880 Pretty simple. 28 00:01:51,290 --> 00:01:54,590 Have a good go at it before I show you the solution.