1 00:00:03,720 --> 00:00:03,990 All right. 2 00:00:04,010 --> 00:00:05,170 So here we are. 3 00:00:05,330 --> 00:00:08,490 And we put together a no do list earlier. 4 00:00:08,520 --> 00:00:11,850 So it's just an empty string array that we create at the top here. 5 00:00:11,840 --> 00:00:17,830 Remember it is indeed a has a wrapper state it can change along with the view. 6 00:00:17,840 --> 00:00:18,030 OK. 7 00:00:18,080 --> 00:00:20,220 So let's think about here's a little bit. 8 00:00:20,240 --> 00:00:26,920 This no do list here will have to be populated with items that we add in our text field. 9 00:00:27,140 --> 00:00:32,480 And if you think about it now let's think where are we going to be adding things into our list. 10 00:00:33,260 --> 00:00:35,740 Meaning this list of arrays there. 11 00:00:35,810 --> 00:00:37,700 This list of strings. 12 00:00:37,730 --> 00:00:39,370 Well let's think a little bit about it. 13 00:00:39,380 --> 00:00:45,950 The idea here is that the moment they hit Enter so to answer something it's not until we hit enter in 14 00:00:46,040 --> 00:00:52,310 our keyboard or if you are actually using the application you hit the enter key or button. 15 00:00:52,310 --> 00:00:52,580 Right. 16 00:00:53,000 --> 00:00:56,980 It's not until then that we are going to be adding something don't know to list. 17 00:00:57,110 --> 00:01:04,220 And hopefully that point will also be able to rebuild and added the item inside of our list or table 18 00:01:04,220 --> 00:01:06,200 view right. 19 00:01:06,220 --> 00:01:11,710 So so that brings us back to our text field here and we have these on commit. 20 00:01:11,710 --> 00:01:14,150 So this is the best place to do so. 21 00:01:14,160 --> 00:01:19,270 Right because it is when we commit something hit enter we want something to happen. 22 00:01:19,600 --> 00:01:23,150 So this is the best place for us to add the code that we want. 23 00:01:23,950 --> 00:01:31,450 Well first of all what we want to do well we want to go say South dot no do list. 24 00:01:31,550 --> 00:01:34,300 Notice we just getting the variable no do list. 25 00:01:34,610 --> 00:01:35,410 And what are we gonna do. 26 00:01:35,420 --> 00:01:42,260 We're going to say insert because he'd send Ray there is a method that we can call call insert an insert. 27 00:01:42,320 --> 00:01:47,420 There's two flavors of conservators to insert that he can see here can actually add a collection of 28 00:01:47,420 --> 00:01:50,930 items but we just want to add a new element. 29 00:01:50,930 --> 00:01:56,130 OK so so in this case he may say insert what am I adding. 30 00:01:56,180 --> 00:02:03,520 Well I'm adding whatever we have insider attacks field which we can get it from our self that now do. 31 00:02:03,560 --> 00:02:11,910 So I'm going to say self dot no do notice I'm not taking the binding one I'm taking just this no do. 32 00:02:11,960 --> 00:02:12,770 There we go. 33 00:02:12,770 --> 00:02:17,660 And at what meaning at what index just put in front meaning at zero. 34 00:02:17,660 --> 00:02:23,150 So every time you add something going to put in front of the end in front of the right what we can do 35 00:02:23,150 --> 00:02:31,130 now we're going to say print and I'm going to say added item like this little interpolation there I'm 36 00:02:31,130 --> 00:02:40,640 going to say self finish that when I say self that no do list just to see if there's something in there 37 00:02:40,910 --> 00:02:42,620 the moment we hit Enter let's run this 38 00:02:47,080 --> 00:02:47,420 OK. 39 00:02:47,420 --> 00:02:50,840 So moment of truth I'm going to say first. 40 00:02:51,020 --> 00:02:51,610 No. 41 00:02:51,620 --> 00:02:55,550 Do enter the moment you do that he can says added item first. 42 00:02:55,550 --> 00:02:59,740 No do was added inside of order no do I know do a right. 43 00:02:59,870 --> 00:03:05,690 In fact if I come down here and add another one second one and you notice what happens. 44 00:03:05,690 --> 00:03:13,250 Now our array has changed and we added the next one but the first one that we added goes to the back 45 00:03:13,280 --> 00:03:15,410 because that's what we said here at zero index. 46 00:03:15,410 --> 00:03:18,010 So just put in front of the array. 47 00:03:18,140 --> 00:03:22,660 Whenever we add so we can keep adding here something like this. 48 00:03:22,850 --> 00:03:24,520 And you can see it keeps going. 49 00:03:24,530 --> 00:03:29,570 So this is indeed working but at this point here we want to do what we want to do is we want to be able 50 00:03:29,570 --> 00:03:39,680 to actually add those items inside of our list to add these items when we commit or when we enter to 51 00:03:39,680 --> 00:03:44,040 our lists automatically while we have to go back down here we have a list no. 52 00:03:44,090 --> 00:03:45,400 Although it was an empty one. 53 00:03:45,500 --> 00:03:46,840 We can do that right. 54 00:03:46,910 --> 00:03:51,770 In fact let me go ahead and delete this and do all over again and when it's a list and in this case 55 00:03:51,780 --> 00:03:54,620 he has the data what is it that we're gonna be adding. 56 00:03:54,620 --> 00:03:55,090 Right. 57 00:03:55,160 --> 00:04:01,730 Well we have the data rate I want to say self DOD a no do list. 58 00:04:02,330 --> 00:04:05,490 I need to pass the identify by in this case here. 59 00:04:05,540 --> 00:04:13,130 We are going to use this self as identifier for each item and then I'm going to say item and look at 60 00:04:13,130 --> 00:04:13,540 this. 61 00:04:13,540 --> 00:04:24,500 And say text and at this point here I can just go ahead and add our item instead of our text and voila 62 00:04:24,890 --> 00:04:28,370 save and run notice now. 63 00:04:28,430 --> 00:04:31,970 Our list is empty of course but there's nothing added but look at this. 64 00:04:31,970 --> 00:04:44,480 The woman would say bye cars enter and voila it's adding second Ender third enter fourth enter and they're 65 00:04:44,510 --> 00:04:47,030 being added automatically. 66 00:04:47,420 --> 00:04:50,960 All of these as possible really is because our no do list. 67 00:04:50,990 --> 00:04:53,420 First of all is indeed a state. 68 00:04:53,450 --> 00:04:56,190 So who knows if something happens is going to go ahead and change. 69 00:04:56,300 --> 00:05:03,620 And most importantly also is that you know do the actual item that is tied or bind or bound I think 70 00:05:03,620 --> 00:05:09,800 that's the right way to say it to our text field we'll know exactly what to do as well because it knows 71 00:05:10,100 --> 00:05:11,800 if something changes anywhere. 72 00:05:11,840 --> 00:05:18,530 Anything pertaining to me a no do variable since I'm bound I'll have to also change that automatically 73 00:05:18,560 --> 00:05:21,570 and do whatever I need to do okay. 74 00:05:21,830 --> 00:05:25,150 So here is the most important part. 75 00:05:25,220 --> 00:05:27,100 This is on comet on comet. 76 00:05:27,110 --> 00:05:31,570 We want to go ahead and insert whatever was committed or whatever we ended. 77 00:05:31,580 --> 00:05:34,400 Now our text field into our array. 78 00:05:34,760 --> 00:05:35,830 Right. 79 00:05:35,900 --> 00:05:39,950 And then once that happens because everything is bound over we have this state. 80 00:05:39,950 --> 00:05:42,960 Everything is connected to the variables in our list. 81 00:05:43,070 --> 00:05:47,450 List to requires to have an actual Ray or a data source. 82 00:05:47,750 --> 00:05:50,170 And we go ahead and insert in our text and voila. 83 00:05:50,210 --> 00:05:54,650 So now as you keep adding We are indeed adding to our array. 84 00:05:54,710 --> 00:05:55,920 You keep adding more. 85 00:05:56,000 --> 00:06:04,100 You can delete all of that stuff there and add something else something and you can keep going. 86 00:06:04,210 --> 00:06:07,940 And just like that we have a very simple no do list working here.