[MUSIC]. >> Okay, welcome back. In this segment, we're going to open up Xcode for the first time and take a look at Xcode playgrounds. I'm gonna open up Xcode from the dock here. And the first thing we see is the welcome screen. So, you get three main ways to start coding in Xcode. The first is getting started with a playground. And I'll go over this in a minute. The second one is to create a new Xcode project. So, you would select this if you're actually starting a new app. And then, the third is check out an existing repository. And then, you could select this if you wanted to start out with code from some online remote source code repository. For example, you could use this to check out code directly from GitHub. But for this Introduction to Swift course, we are mainly going to use playgrounds to practice coding in Swift. Okay? So, we'll start by creating a new playground. The first thing it wants is a name. You can just choose any name here. And then, the second option is to choose a platform. This playground is just for practice, but it still gives you access to Apple's platform APIs and frameworks for either iOS or OS X. But we want to make sure to use iOS for this course. And then, click next and just put it on your desktop or somewhere where you wanna keep your project files for this course. And it'll create a single file, a bundle of files, really, for this playground. So, here is the basic Playground screen. What you can do is you have a code editor on the left and a results window on the right. So, you can actually see as I start typing in some code, just type in a few lines here, what it will do as I'm typing it in. It's going to evaluate the code live while I'm typing it in. And then, on the right-hand side it shows you the results of each line of code. I, if I hold down the option key on the keyboard, I can actually inspect the code and it'll bring a pop-up if I click on the, on the variable name. It'll bring up a pop-up that shows me, for example, the inferred type of this variable. So, you'll learn more about types and inferred types later on in this course with Swift. And, actually, if I find a framework symbol in this as well, I can hold down the Option key, click on it. And it will give me actually a lot of information about that class. So, holding the option key is almost like getting an x-ray into the code that you're typing. You also notice there, cuz I just typed in one sort of line here that wasn't quite complete, it just gave me an error message there. If I type maybe something that's not syntactically correct, you can see that it's also live checking my code to look for errors. And maybe sometimes will suggest a resolution for each error as well. So, we'll just get rid of that error message. So, this is a pretty minimalist interface. You can actually add more stuff onto this screen. There's more features to playgrounds than you can see initially. To get the more advanced stuff, you right click on the title bar at the top and go to Show Toolbar. And then, what we get are three buttons here that can show or hide other panels in this that will give us more functionality in this screen. So, first thing I'll do is look at the navigation panel. From here, we can add resources and we can create additional swift files. So, you don't have to keep all of your code in your playground in one file. You can actually create different sources and add additional sources. Maybe separate different classes into different files. So, you can right-click on here and add, for example, another new swift file that will be included in your project and can be referenced from your code. You can also drag in some, you can drag in resources. So, you can drag in an image if you want to add an image to your project and reference that. It's good to just add it into the resources folder there so that you can directly reference it in your code. So, for example, I can reference this image if I type in some code to load the image, go. So, it can load that image that I've just included in this project. And you'll see right now it's actually evaluating it live again. And you see the results. This time it prints the size of the image by default as the result. But if I click on this quick look button here, I can see the image and how it appears once it's been loaded. And I can also click this results, show or hide results button, which will actually show the results of this line directly in line with the rest of my code. Okay. So, that is the navigation panel. There's another panel that we can open. It's kinda useful. And maybe I'll just open up, maybe expand this window a little bit now that we have some more panels on the screen here. And you can see there's a quick help option here on this right-hand panel. And it's called the Utilities panel. And it has two tabs. It has the file inspector and the quick help tab. So, if I click on assemble here, it will look up help in the documentation and show it to me right away. So, it's kinda like that option click thing, except it's always here and it's easy to check at a glance. And then, finally, you have this tab here. It says the meta data, set of a file meta data tab. And it lists some details about the current file that you have loaded. And usually it's just, if you want to find out where a file is stored that's included in your project, it's an easy way to find that. Okay. So, that is the basics of playgrounds. I hope you can feel comfortable now to jump in and start typing in some Swift code and see what happens. And in the next video we'll look at actual projects and how they work in X code. Thank you.