1 00:00:00,710 --> 00:00:05,980 So we come again in this lesson we're going to talk about the outlets and what they are. 2 00:00:06,160 --> 00:00:12,640 Outlets are essentially decoding part of our interface elements are the way for us to connect pieces 3 00:00:12,640 --> 00:00:15,800 of the visual elements into our coding interface. 4 00:00:16,030 --> 00:00:21,340 Very similar to what you saw me doing in the previous lesson in this lesson going through all of that 5 00:00:21,400 --> 00:00:22,160 together. 6 00:00:22,420 --> 00:00:28,810 So this one to explode like always I'm going to start a brand new project somebody closed this project 7 00:00:29,370 --> 00:00:36,130 and when I say command shift and and this new project single view application I'm going to call it outlet's 8 00:00:36,390 --> 00:00:37,330 project. 9 00:00:37,570 --> 00:00:40,900 So my out this project all the settings are similar as before. 10 00:00:40,900 --> 00:00:42,560 Language is Objective-C. 11 00:00:42,670 --> 00:00:51,630 And then I have the next and now go to my storyboard main storyboard file the file that you always work 12 00:00:51,630 --> 00:00:52,290 on. 13 00:00:52,310 --> 00:00:59,210 I don't want to add a few different labels so I'm going to say Give me one label here. 14 00:01:00,560 --> 00:01:02,870 This one is the one that is here. 15 00:01:03,260 --> 00:01:05,690 And you might want to do your own version of things. 16 00:01:05,690 --> 00:01:10,910 It doesn't matter that you completely follow me or exactly follow without doing it just that you know 17 00:01:10,910 --> 00:01:12,460 let's have a few different items. 18 00:01:12,460 --> 00:01:14,750 This one has a green background. 19 00:01:14,810 --> 00:01:21,530 I'm going to make another lever on two to copy a label you could just hold the old button and drag it. 20 00:01:21,530 --> 00:01:27,000 So if you hold the alt under right it makes another one and every time you do it it makes a new one. 21 00:01:27,200 --> 00:01:30,060 So I'm going to change the background color for this one. 22 00:01:30,200 --> 00:01:34,380 I'm going to say this one has got a pinkish white. 23 00:01:34,670 --> 00:01:41,690 I'm going to select the one in the middle say that one actually has a maybe a bluish background. 24 00:01:41,870 --> 00:01:45,260 So I've got two the colors green blue and pink. 25 00:01:45,390 --> 00:01:51,200 And I went I have three different labels for each of them so I want each of them to show me something 26 00:01:51,350 --> 00:01:53,310 different as the peron's. 27 00:01:53,320 --> 00:01:54,640 Not in here. 28 00:01:54,890 --> 00:02:01,340 So to do that I'm going to open this little window which is the assistant editor what the assistant 29 00:02:01,340 --> 00:02:02,210 editor does. 30 00:02:02,210 --> 00:02:08,780 It allows me to have more than just one file open here because right now when I click on any of these 31 00:02:08,780 --> 00:02:15,440 files that one gets popped open in my editor window but I want to be able to see two of them essentially 32 00:02:15,440 --> 00:02:16,630 side by side. 33 00:02:16,880 --> 00:02:24,190 So I'm going to go to my age file I'm going to open my assistant editor and the assistant editor. 34 00:02:24,200 --> 00:02:27,630 Now I have to load my other for my storyboard. 35 00:02:27,710 --> 00:02:32,840 So one of them is my story but it doesn't matter whether it is on the one on the left or the one on 36 00:02:32,840 --> 00:02:35,210 the right and then the other side. 37 00:02:35,210 --> 00:02:39,250 And when I go up here and say Give me the h file. 38 00:02:39,410 --> 00:02:46,220 So spend a little time make sure you understand this set up you have a few items in here preferably 39 00:02:46,220 --> 00:02:54,400 all of them off the type label and then open both of them side by side using the assistant editor. 40 00:02:54,860 --> 00:02:59,460 So once you have that we can go over here on Connect them together. 41 00:02:59,480 --> 00:03:04,820 I'm actually going to get myself a little bit more space like this so I know what I'm doing. 42 00:03:04,820 --> 00:03:09,330 So in my dad's age for I'm going to get myself a little bit more space. 43 00:03:09,410 --> 00:03:16,040 I'm going to hold the control button and try get the green one over in here and it tells me you want 44 00:03:16,040 --> 00:03:21,990 to make an outlet and I'm going to say yes call it your e-mail label. 45 00:03:22,130 --> 00:03:29,420 It's a common practice to finish the end of each of the names with that type of that object. 46 00:03:29,540 --> 00:03:33,500 So for instance these guys are labels we call them green labels. 47 00:03:33,530 --> 00:03:40,280 If this was a text field that user had to enter their user name he would call it user name textfield 48 00:03:40,580 --> 00:03:43,900 with ended with the same type of suffix. 49 00:03:44,000 --> 00:03:48,790 That is the type of that object in saying that you don't have to do that. 50 00:03:48,800 --> 00:03:54,110 The one thing you should remember is that you shouldn't start these guys with a numeric value. 51 00:03:54,110 --> 00:03:57,410 They have to be a started with an alphabetical value. 52 00:03:57,650 --> 00:04:01,930 So let's put that another one I'm going to say control from the blue one. 53 00:04:01,940 --> 00:04:03,420 Let's try it in yeah. 54 00:04:03,700 --> 00:04:04,520 And this one. 55 00:04:04,520 --> 00:04:07,330 I'm going to call it Blue Label. 56 00:04:07,700 --> 00:04:13,160 There are a lot of things in yellow such as whether you want to make an outfit or an outfit collection 57 00:04:13,430 --> 00:04:18,370 if you're doing other type of objects it might ask you if you want to make an action out of it. 58 00:04:18,500 --> 00:04:21,410 That is the type of storage is v or not. 59 00:04:21,410 --> 00:04:24,210 It will just cause all of these things in their own due time. 60 00:04:24,230 --> 00:04:29,180 But for now let's just make another one and then I'm going to make the third one. 61 00:04:29,180 --> 00:04:36,720 So this one that I want to control drag it over here and this one is going to be the pink label. 62 00:04:36,770 --> 00:04:44,660 So all three labels are not connected to some sort of IP outlet interface based outlet. 63 00:04:44,720 --> 00:04:49,240 Now between my court and that is of course in my h file. 64 00:04:49,460 --> 00:04:52,770 Now once again what is non-atomic v. 65 00:04:52,790 --> 00:04:53,840 What is property. 66 00:04:53,840 --> 00:04:55,430 We'll talk about these things. 67 00:04:55,440 --> 00:04:59,870 These are primarily about the storage and memory management and threading. 68 00:04:59,880 --> 00:05:02,900 And we will talk about this when the time comes. 69 00:05:02,900 --> 00:05:05,070 For now just learn it like this. 70 00:05:05,060 --> 00:05:11,030 You can check the different properties with different outlets and now you have access to them in your 71 00:05:11,030 --> 00:05:12,740 coding environment. 72 00:05:12,740 --> 00:05:17,000 Now that closed system it's off and on but I've got my dog. 73 00:05:17,030 --> 00:05:19,640 Just a quick review of what they have done. 74 00:05:19,640 --> 00:05:21,500 These are the three lines of code. 75 00:05:21,540 --> 00:05:27,200 Again it doesn't matter how you format it but since it's a programming language you're just getting 76 00:05:27,200 --> 00:05:29,450 used to learning the very basics. 77 00:05:29,660 --> 00:05:32,150 You can't add anything that you like. 78 00:05:32,150 --> 00:05:36,590 It's must follow the certain rules of the programming language. 79 00:05:36,590 --> 00:05:38,520 Let me give you an example. 80 00:05:38,840 --> 00:05:42,200 A programming language is very similar to a human language. 81 00:05:42,200 --> 00:05:51,640 So for instance if I had something saying I was in a bus yesterday that makes all the sense you and 82 00:05:51,650 --> 00:05:57,500 that is because you know I'm using the correct vocabulary and the right drama of the English language. 83 00:05:57,540 --> 00:06:08,590 However if I wrote something such as a home made to day and of blueberries that kind of doesn't make 84 00:06:08,590 --> 00:06:09,230 any sense. 85 00:06:09,250 --> 00:06:15,580 Even though you're using some right terminology is it doesn't really produce a sentence and that is 86 00:06:15,580 --> 00:06:20,980 simply because you have to follow the grammar of the language that you're writing in a very similar 87 00:06:20,980 --> 00:06:24,940 thing applies to programming language and you have to learn all of those. 88 00:06:24,940 --> 00:06:30,370 One step at a time and as we go along and you build on the Von's for Objective-C and then from there 89 00:06:30,370 --> 00:06:36,790 on the move on to sweet thing you've And the vase for swift but whatever you are in here make sure that 90 00:06:36,820 --> 00:06:37,980 you don't get an error. 91 00:06:37,990 --> 00:06:40,730 So you can't just randomly go in here. 92 00:06:41,050 --> 00:06:48,700 I don't know or write something such as my brown label because if you do that you will definitely get 93 00:06:48,730 --> 00:06:54,490 an error that pops and tells you that hey you have written something in here which we don't know what 94 00:06:54,490 --> 00:06:58,540 it is and want to type name y brown label. 95 00:06:58,540 --> 00:07:01,680 So my suggestion is that for the time being. 96 00:07:01,720 --> 00:07:04,980 Even though this isn't the most intuitive way of doing it. 97 00:07:05,140 --> 00:07:10,570 Just follow my code and in a few lessons you will get a much better sense of what you can learn but 98 00:07:10,560 --> 00:07:16,420 you cannot write and what different rules you should follow and then you get to a point that they can 99 00:07:16,420 --> 00:07:20,360 actually teach you more and more about the programming itself. 100 00:07:20,530 --> 00:07:26,110 Because for now most of what we're doing is just to get a sense of how the application gets developed 101 00:07:26,110 --> 00:07:29,380 and basically building your confidence in that. 102 00:07:29,380 --> 00:07:35,880 So in saying that I have three lines of code that green label Blue Label and pink label are being made. 103 00:07:36,100 --> 00:07:39,070 And from there I'm going to go to my God I'm fine. 104 00:07:39,250 --> 00:07:41,910 And again don't worry about anything that's happening in here. 105 00:07:41,920 --> 00:07:46,750 Let's just worry about this one method within these two Carol-Lee brackets. 106 00:07:46,750 --> 00:07:52,780 So this one on that one I'm going to get myself a little with more space between them. 107 00:07:53,050 --> 00:08:06,250 I'm going to go ahead and say Blue Label dot text says are blue and semicolon at the end up as if you 108 00:08:06,240 --> 00:08:09,000 are getting to learn one step at a time. 109 00:08:09,010 --> 00:08:15,010 Almost every line in a programming language needs to be close with a semicolon or in this programming 110 00:08:15,010 --> 00:08:21,300 language in Objective-C unless there is a bracket or panaceas coming up after it. 111 00:08:21,460 --> 00:08:27,280 So keep that in mind that most lines they end up having a semicolon at the end of it and that's essentially 112 00:08:27,280 --> 00:08:30,210 terminating one line of code. 113 00:08:30,280 --> 00:08:43,930 So the score has an hour another one green label dot text x are green and let's say pink one is a pink 114 00:08:44,200 --> 00:08:50,320 pink label dot text it says I am not. 115 00:08:50,400 --> 00:08:50,790 Yes. 116 00:08:50,810 --> 00:08:52,630 All right. 117 00:08:52,630 --> 00:08:59,140 So as you can expect right now in the Lord this application and we run this publication these three 118 00:08:59,140 --> 00:09:05,200 labels in our interface should say that three different things that we ask them to say. 119 00:09:05,200 --> 00:09:08,900 As always I'm using the iPhone 8 now. 120 00:09:09,120 --> 00:09:14,970 And because of that I'm going to set my simulator to be iPhone 8 and then I'm going to run it. 121 00:09:15,160 --> 00:09:19,420 You know what something I'm actually going to do and you might want to do the same as well because the 122 00:09:19,420 --> 00:09:22,010 default view is iPhone 8. 123 00:09:22,060 --> 00:09:29,190 I'm actually going to go to my devices on simulators and I'm actually going to hide iPhone 8 plus. 124 00:09:29,470 --> 00:09:35,620 So my default iPhone will be iPhone 8 whenever I'm developing anything. 125 00:09:35,620 --> 00:09:44,650 So with that in mind let's go ahead and build on Ron once it launches the application we should see 126 00:09:45,100 --> 00:09:49,530 three labels each of them saying something at the wrong time. 127 00:09:49,540 --> 00:09:52,650 I'm green I'm blue not yellow. 128 00:09:52,660 --> 00:09:58,660 Now we pack a lot of stuff in this list and a lot of it doesn't make sense to you just yet and that's 129 00:09:58,660 --> 00:09:59,650 perfectly fine. 130 00:09:59,650 --> 00:10:06,410 This lesson is just simply meant to give you the confidence of knowing what some of these things are 131 00:10:06,410 --> 00:10:13,210 and how do you make outlets How do you connect different items from your interface into your coding 132 00:10:13,210 --> 00:10:14,100 environment. 133 00:10:14,230 --> 00:10:19,600 So if you got that part and if you can make these connections it means you know you're perfectly there 134 00:10:20,140 --> 00:10:26,200 and you know we can move on to the next lesson Don't worry about the specifics of you know what is this 135 00:10:26,200 --> 00:10:32,470 life cycle or the view controller or why are we using it that operation and so on and so forth. 136 00:10:32,560 --> 00:10:36,780 All of these things will cover them in the coming lessons with that in mind. 137 00:10:36,790 --> 00:10:39,780 Let's move on to seeing another type of outlet's.