1 00:00:00,390 --> 00:00:02,310 OK, so how did you find that task? 2 00:00:02,340 --> 00:00:08,190 Well, I've completed it here with basically three lines of code, but one important line and you'll 3 00:00:08,190 --> 00:00:11,170 notice that I can't actually swipe this down. 4 00:00:11,220 --> 00:00:13,020 I simply cannot dismiss it. 5 00:00:13,410 --> 00:00:21,320 But if I do my usual rubbish and I register that person, it will disappear. 6 00:00:21,720 --> 00:00:24,930 And how I've done that is I had to override the view. 7 00:00:24,930 --> 00:00:26,140 Did load, first of all. 8 00:00:26,400 --> 00:00:28,830 So this is a life-cycle call. 9 00:00:29,370 --> 00:00:34,100 The View, the view controller that we're loading goes through lifecycle. 10 00:00:34,110 --> 00:00:39,660 So first it gets called and then it gets initialized and then the view gets prepared and then the view 11 00:00:39,660 --> 00:00:42,860 loads, but it isn't shown and then the view appears. 12 00:00:43,290 --> 00:00:45,030 So at the point it loads. 13 00:00:45,030 --> 00:00:49,830 I know I have everything available to me that a view controller can do, but it's not yet shown. 14 00:00:50,080 --> 00:00:54,450 So before it shows, I get to say is modal in presentation. 15 00:00:54,450 --> 00:01:00,870 Now, modal means it just pops up on the screen and there's no way to dismiss it unless I plumb that 16 00:01:00,870 --> 00:01:01,830 in somehow. 17 00:01:02,070 --> 00:01:06,780 And of course with our login register items, we've already plumbed that in. 18 00:01:06,810 --> 00:01:13,650 So we don't need to do anything more and simply set that to true and then we can't actually swipe anything 19 00:01:13,650 --> 00:01:14,080 away. 20 00:01:14,490 --> 00:01:16,710 So that was the homework that was pretty simple. 21 00:01:17,220 --> 00:01:23,190 If you got stuck, it's probably because you didn't use the right terminology on Google when you were 22 00:01:23,190 --> 00:01:24,780 searching for this solution. 23 00:01:25,650 --> 00:01:27,410 Now, what did I use here? 24 00:01:28,200 --> 00:01:32,460 I use the words prevent view controller from dismissing. 25 00:01:33,400 --> 00:01:38,260 And I got loads and loads of Google hits, some are old, some of the code didn't work because it is 26 00:01:38,260 --> 00:01:44,650 that old, but someone said an iOS 13, we get this new popover view, the one that we're seeing within 27 00:01:44,650 --> 00:01:45,670 our particular app. 28 00:01:46,030 --> 00:01:50,430 And the way to stop it from swiping away is to just set that to true. 29 00:01:50,470 --> 00:01:51,340 That's the easy way. 30 00:01:51,580 --> 00:01:55,520 There are other ways of doing it, but we'll just do it the easy way. 31 00:01:55,600 --> 00:01:56,590 Thank you very much.