1 00:00:00,540 --> 00:00:03,100 ‫-: Hi. Within this lecture we are going to 2 00:00:04,013 --> 00:00:05,640 ‫create our first Xcode project 3 00:00:05,640 --> 00:00:10,230 ‫and we're going to start building our first iOS app. 4 00:00:10,230 --> 00:00:13,110 ‫So if you have closed Xcode for some reason, 5 00:00:13,110 --> 00:00:16,020 ‫you can come over here to Launchpad and click 6 00:00:16,020 --> 00:00:17,760 ‫on the Xcode icon, 7 00:00:17,760 --> 00:00:22,440 ‫or you can hit comment and space in your keyboard and search 8 00:00:22,440 --> 00:00:27,440 ‫for Xcode and find it and click on it to open the Xcode. 9 00:00:27,840 --> 00:00:32,460 ‫Okay, so if you have not closed the Xcode yet, 10 00:00:32,460 --> 00:00:37,361 ‫so it's better and you are seeing a screen like this. 11 00:00:37,361 --> 00:00:40,650 ‫So you have three options over here. 12 00:00:40,650 --> 00:00:44,160 ‫Okay? So first you can start with a playground. 13 00:00:44,160 --> 00:00:46,523 ‫So playground is actually a playground 14 00:00:46,523 --> 00:00:49,770 ‫in which we can play with the SWIFT code 15 00:00:49,770 --> 00:00:52,950 ‫in which we can learn the basics of the Swift. 16 00:00:52,950 --> 00:00:56,400 ‫And the third one is to clone an existing project. 17 00:00:56,400 --> 00:01:00,960 ‫So this is basically copying an existing Xcode project 18 00:01:00,960 --> 00:01:02,940 ‫but we want this one. 19 00:01:02,940 --> 00:01:04,500 ‫Okay, we want in the middle. 20 00:01:04,500 --> 00:01:07,125 ‫So create a new Xcode project. 21 00:01:07,125 --> 00:01:10,428 ‫If you click on that, you will see a screen like this 22 00:01:10,428 --> 00:01:15,217 ‫in which you will choose a template for your Xcode project. 23 00:01:15,217 --> 00:01:18,360 ‫So as you can see, we have a lot 24 00:01:18,360 --> 00:01:21,990 ‫of templates and during the course we will work some 25 00:01:21,990 --> 00:01:26,990 ‫of these templates and we will see these tabs as well. 26 00:01:27,000 --> 00:01:32,000 ‫So this is for TV os and this is for Mac os. 27 00:01:32,490 --> 00:01:33,900 ‫If you know Swift, 28 00:01:33,900 --> 00:01:38,900 ‫you can just create apps for TV, os, Mac OS, or iOS. 29 00:01:39,090 --> 00:01:40,680 ‫But we are going to focus mainly 30 00:01:40,680 --> 00:01:45,680 ‫on iOS and we mainly going to choose the single view app. 31 00:01:46,350 --> 00:01:50,700 ‫This is the most basic empty template because we 32 00:01:50,700 --> 00:01:54,383 ‫are going to learn how to create things from scratch, okay? 33 00:01:54,383 --> 00:01:57,762 ‫We are not going to need any templates for us 34 00:01:57,762 --> 00:01:59,724 ‫at least at this moment. 35 00:01:59,724 --> 00:02:02,820 ‫In the future, in the following sections 36 00:02:02,820 --> 00:02:06,922 ‫we are going to see some other ready templates for us. 37 00:02:06,922 --> 00:02:11,922 ‫But for the time being, I'm going to go for Single View app. 38 00:02:12,303 --> 00:02:15,960 ‫And also keep in mind that if you choose Single View app 39 00:02:15,960 --> 00:02:19,980 ‫you can later on add some more features on it as well. 40 00:02:19,980 --> 00:02:21,780 ‫So here you see a game. 41 00:02:21,780 --> 00:02:25,050 ‫So this basically lets you create a game 42 00:02:25,050 --> 00:02:26,220 ‫with a physical word 43 00:02:26,220 --> 00:02:28,980 ‫and we are going to see what it is later on. 44 00:02:28,980 --> 00:02:32,029 ‫So this is for example, an augmented reality app 45 00:02:32,029 --> 00:02:35,490 ‫and we are going to work with that one as well. 46 00:02:35,490 --> 00:02:38,250 ‫And we are going to see the other templates. 47 00:02:38,250 --> 00:02:42,510 ‫But right now the most basic thing to do is just 48 00:02:42,510 --> 00:02:46,140 ‫to create a single view app and add everything 49 00:02:46,140 --> 00:02:50,850 ‫in here manually and not worry about all these other 50 00:02:50,850 --> 00:02:52,747 ‫templates at this moment. 51 00:02:52,747 --> 00:02:56,288 ‫So choose this and come here and click next. 52 00:02:56,288 --> 00:03:00,568 ‫So once you click next, you will either present 53 00:03:00,568 --> 00:03:04,020 ‫at this page or a very similar version. 54 00:03:04,020 --> 00:03:07,110 ‫So it has a slight difference in some versions 55 00:03:07,110 --> 00:03:10,200 ‫and I'm going to show you what it is, don't worry. 56 00:03:10,200 --> 00:03:13,943 ‫So here we see the general settings of our project 57 00:03:13,943 --> 00:03:16,309 ‫like a product name, okay? 58 00:03:16,309 --> 00:03:18,930 ‫For example for our product name, 59 00:03:18,930 --> 00:03:21,725 ‫I'm gonna go for My first app 60 00:03:21,725 --> 00:03:25,560 ‫and of course later on we are going to see how 61 00:03:25,560 --> 00:03:29,970 ‫we can change this name from our Xcode project as well. 62 00:03:29,970 --> 00:03:32,820 ‫And in fact, we can change every setting that we 63 00:03:32,820 --> 00:03:36,150 ‫are making here later on, but we need to make sure 64 00:03:36,150 --> 00:03:39,270 ‫that we are just doing the right thing from scratch. 65 00:03:39,270 --> 00:03:42,150 ‫So I'm going to show you how to work with this. 66 00:03:42,150 --> 00:03:45,231 ‫So in the team, you're most probably seeing this none. 67 00:03:45,231 --> 00:03:48,060 ‫And in my case, I am seeing my name 68 00:03:48,060 --> 00:03:50,190 ‫which is not important at this point. 69 00:03:50,190 --> 00:03:51,660 ‫So if you're seeing none 70 00:03:51,660 --> 00:03:54,180 ‫then it's okay to proceed with none. 71 00:03:54,180 --> 00:03:56,340 ‫Once we go into the Xcode 72 00:03:56,340 --> 00:04:00,595 ‫I'm going to show you how you can add your Apple ID 73 00:04:00,595 --> 00:04:04,320 ‫to your Xcode so that they will be connected. 74 00:04:04,320 --> 00:04:07,650 ‫In my case, now I see my name, I'm just going to go 75 00:04:07,650 --> 00:04:10,870 ‫with those, but again, it's not important right now. 76 00:04:10,870 --> 00:04:14,220 ‫Over here we have an organization name. 77 00:04:14,220 --> 00:04:16,860 ‫So either you write your company's name 78 00:04:16,860 --> 00:04:18,540 ‫or you can write your own name 79 00:04:18,540 --> 00:04:20,850 ‫if you're working for yourself. 80 00:04:20,850 --> 00:04:22,969 ‫So once you write your organization name 81 00:04:22,969 --> 00:04:26,816 ‫it creates an organization identifier for you. 82 00:04:26,816 --> 00:04:29,638 ‫As you can see, this is a reverse domain 83 00:04:29,638 --> 00:04:34,638 ‫so it's com.atilsam rather than atilsam.com 84 00:04:35,100 --> 00:04:38,531 ‫So this can be changed of course, 85 00:04:38,531 --> 00:04:41,460 ‫but using this organization name 86 00:04:41,460 --> 00:04:44,208 ‫and using these organization identifier 87 00:04:44,208 --> 00:04:48,289 ‫actually Xcode creates a bundle identifier for us. 88 00:04:48,289 --> 00:04:50,182 ‫So this is important 89 00:04:50,182 --> 00:04:54,553 ‫because this is the unique ID of our app. 90 00:04:54,553 --> 00:04:57,330 ‫So as you can see, it takes the product name 91 00:04:57,330 --> 00:04:59,640 ‫and it takes the organization identifier 92 00:04:59,640 --> 00:05:03,120 ‫and it creates a bundle identifier for our app. 93 00:05:03,120 --> 00:05:08,120 ‫So this is a differentiating ID for our app so that 94 00:05:08,940 --> 00:05:11,880 ‫when we upload this to the app store, 95 00:05:11,880 --> 00:05:14,730 ‫they can understand which app is which app 96 00:05:14,730 --> 00:05:18,130 ‫by actually looking at their bundle identifiers. 97 00:05:18,130 --> 00:05:22,350 ‫So we can change this later on as well when 98 00:05:22,350 --> 00:05:23,880 ‫we open the Xcode. 99 00:05:23,880 --> 00:05:27,171 ‫But this is somewhat important so if you're building 100 00:05:27,171 --> 00:05:31,200 ‫a real app just try to come up with a good product name 101 00:05:31,200 --> 00:05:34,590 ‫and write your own organization name like your name. 102 00:05:34,590 --> 00:05:39,030 ‫And over here we have the language section as well. 103 00:05:39,030 --> 00:05:41,040 ‫And as you can see, we have two options 104 00:05:41,040 --> 00:05:43,486 ‫either Swift or Objective-C. 105 00:05:43,486 --> 00:05:46,470 ‫We are focusing on Swift in this course 106 00:05:46,470 --> 00:05:49,776 ‫because Swift has been released by Apple five years ago 107 00:05:49,776 --> 00:05:54,776 ‫and now it's actually very popular programming language 108 00:05:54,896 --> 00:05:57,775 ‫and it's one of the best ones in the world. 109 00:05:57,775 --> 00:06:00,330 ‫So it's very easy to understand 110 00:06:00,330 --> 00:06:03,750 ‫very easy to use, and it's, I believe in my opinion, 111 00:06:03,750 --> 00:06:06,616 ‫it's much more better when we compare it to Objective-C. 112 00:06:06,616 --> 00:06:09,193 ‫So we are gonna go for Swift. 113 00:06:09,193 --> 00:06:11,631 ‫So after Swift has been released, 114 00:06:11,631 --> 00:06:15,451 ‫most of the projects has been shifted to Swift anyway 115 00:06:15,451 --> 00:06:18,713 ‫so that's what we are going to learn in this course. 116 00:06:18,713 --> 00:06:22,865 ‫And here we have this user interface tab. 117 00:06:22,865 --> 00:06:27,240 ‫Okay? So we are going to choose storyboard 118 00:06:27,240 --> 00:06:29,853 ‫from this tab rather than SwiftUI. 119 00:06:29,853 --> 00:06:33,720 ‫So SwiftUI is actually a new concept introduced 120 00:06:33,720 --> 00:06:37,069 ‫by Apple into our worlds, and it actually 121 00:06:37,069 --> 00:06:40,912 ‫lets us create stunning user interfaces. 122 00:06:40,912 --> 00:06:44,460 ‫Later on in the course we are going to have 123 00:06:44,460 --> 00:06:48,720 ‫a SwiftUI section as well, but right now we're gonna focus 124 00:06:48,720 --> 00:06:52,533 ‫on storyboards because this SwiftUI is kind of new 125 00:06:52,533 --> 00:06:56,051 ‫and it will be effective as of iOS 13 126 00:06:56,051 --> 00:07:00,000 ‫so that people would have to install iOS 13 127 00:07:00,000 --> 00:07:04,050 ‫or above into their phones in order to make this work. 128 00:07:04,050 --> 00:07:06,450 ‫So we are going to have to wait a little bit 129 00:07:06,450 --> 00:07:09,600 ‫more to shift every project to SwiftUI. 130 00:07:09,600 --> 00:07:12,240 ‫And we are going to use storyboards most 131 00:07:12,240 --> 00:07:15,373 ‫of the time in this course for that perspective. 132 00:07:15,373 --> 00:07:17,970 ‫And don't worry, the codes are the same. 133 00:07:17,970 --> 00:07:21,100 ‫Actually we use Swift in storyboard, user interface 134 00:07:21,100 --> 00:07:23,996 ‫and we use Swift in SwiftUI as well. 135 00:07:23,996 --> 00:07:27,231 ‫And this is only related to the user interface 136 00:07:27,231 --> 00:07:31,620 ‫the design of the app, if you may say, okay? 137 00:07:31,620 --> 00:07:34,860 ‫And over here you will see some check boxes 138 00:07:34,860 --> 00:07:36,300 ‫like use core data. 139 00:07:36,300 --> 00:07:39,570 ‫So this will let us create a local database 140 00:07:39,570 --> 00:07:41,820 ‫to use in our apps. 141 00:07:41,820 --> 00:07:44,220 ‫Right now we don't need those, right now 142 00:07:44,220 --> 00:07:46,200 ‫we don't need any tests as well. 143 00:07:46,200 --> 00:07:50,014 ‫Later on we are gonna see what we can make with core data. 144 00:07:50,014 --> 00:07:53,590 ‫And the other screen that you can see when 145 00:07:53,590 --> 00:07:56,732 ‫you open your first project is this. 146 00:07:56,732 --> 00:08:00,120 ‫So again, here everything seems to be the same 147 00:08:00,120 --> 00:08:03,630 ‫like this language tab over here, you can choose Swift 148 00:08:03,630 --> 00:08:04,740 ‫or Objective-C. 149 00:08:04,740 --> 00:08:07,060 ‫From here you can write your product name 150 00:08:08,113 --> 00:08:10,290 ‫and everything, but as you can see, Swift UI is 151 00:08:10,290 --> 00:08:12,420 ‫in the checkbox list as well. 152 00:08:12,420 --> 00:08:15,810 ‫So rather than choosing Storyboard, you can just 153 00:08:15,810 --> 00:08:18,688 ‫ignore Swift UI over here, just uncheck it. 154 00:08:18,688 --> 00:08:21,990 ‫If it's checked, then it'll create a project 155 00:08:21,990 --> 00:08:23,910 ‫for you using storyboards. 156 00:08:23,910 --> 00:08:27,431 ‫So this is the only difference that you can get 157 00:08:27,431 --> 00:08:31,410 ‫with regarding to different Xcode versions. 158 00:08:31,410 --> 00:08:35,250 ‫So Apple hasn't decided which version to go with yet. 159 00:08:35,250 --> 00:08:38,400 ‫So you can either see this or the previous screen 160 00:08:38,400 --> 00:08:41,220 ‫that I have shown you, and it doesn't matter, 161 00:08:41,220 --> 00:08:44,755 ‫just uncheck the Swift UI or just choose this storyboard 162 00:08:44,755 --> 00:08:47,910 ‫from the dropdown menu. 163 00:08:47,910 --> 00:08:50,280 ‫And after you do all of these things, 164 00:08:50,280 --> 00:08:53,817 ‫now you're ready to create your first project. 165 00:08:53,817 --> 00:08:57,956 ‫So don't forget to fill this information up 166 00:08:57,956 --> 00:09:01,890 ‫and don't forget to click next here because we 167 00:09:01,890 --> 00:09:06,192 ‫are going to choose where to save our project next. 168 00:09:06,192 --> 00:09:11,192 ‫So, I have created a folder in my desktop named iOS Complete 169 00:09:12,810 --> 00:09:15,587 ‫because I'm going to save all of the projects in here. 170 00:09:15,587 --> 00:09:18,810 ‫You can just choose wherever you want. 171 00:09:18,810 --> 00:09:21,420 ‫You can save your projects wherever you want 172 00:09:21,420 --> 00:09:23,160 ‫on your computer. 173 00:09:23,160 --> 00:09:25,274 ‫And after you choose your folder 174 00:09:25,274 --> 00:09:28,235 ‫you can just click create here. 175 00:09:28,235 --> 00:09:31,530 ‫And in this source control pane 176 00:09:31,530 --> 00:09:35,520 ‫you will see some option to create get GitHub repositories. 177 00:09:35,520 --> 00:09:39,270 ‫We're going to see what a Git is, later on in the course. 178 00:09:39,270 --> 00:09:42,873 ‫This is basically a say point checkpoint for your apps. 179 00:09:44,008 --> 00:09:46,433 ‫Okay? So you can go back in time 180 00:09:46,433 --> 00:09:48,593 ‫if you mess up with something in your code. 181 00:09:48,593 --> 00:09:51,150 ‫And I'm going to go for that 182 00:09:51,150 --> 00:09:55,190 ‫and I will say create a Git repository on my Mac. 183 00:09:55,190 --> 00:09:57,588 ‫We're going to see what a GitHub 184 00:09:57,588 --> 00:10:01,290 ‫and what a Git is later on, as I said. 185 00:10:01,290 --> 00:10:05,307 ‫So let's create our project, and once you do that 186 00:10:05,307 --> 00:10:09,189 ‫it will actually create some files and folders. 187 00:10:09,189 --> 00:10:13,860 ‫And this will be the project pane that we are working 188 00:10:13,860 --> 00:10:17,670 ‫that we will be working on those files and folders. 189 00:10:17,670 --> 00:10:21,652 ‫If you open your folder over here, you will see some apps, 190 00:10:21,652 --> 00:10:24,300 ‫you will see some project files, 191 00:10:24,300 --> 00:10:28,548 ‫project folders in your project folder. 192 00:10:28,548 --> 00:10:32,550 ‫Okay? And in fact, if I close this 193 00:10:32,550 --> 00:10:35,760 ‫down and if I close my Xcode project down 194 00:10:35,760 --> 00:10:40,620 ‫I can go back to my folder and I can find my project file. 195 00:10:40,620 --> 00:10:44,048 ‫And if I double click on this, it will pop open again 196 00:10:44,048 --> 00:10:47,270 ‫so I can start working on my project. 197 00:10:47,270 --> 00:10:51,030 ‫If you how come this far, we can stop here. 198 00:10:51,030 --> 00:10:53,880 ‫And we are going to continue building our app 199 00:10:53,880 --> 00:10:55,653 ‫on the next lecture.