[MUSIC] Hi, everyone. In this module, we're going to look at watchOS 2 development, which is a very exciting, very, very new app platform that Apple just released basically this year for watchOS 2 late last year and it was basically a huge upgrade to watchOS 1 that allows watch apps to run natively on the Apple watch. This is very exciting and we're going to show you in this module how you can build a watch app for your own app. So first of all in this lecture, we're going to show you how you can add a watch app to your project. And then in the subsequent lectures, we'll go into the details of building a watch app. The first thing you need to know is that watch apps are not stand alone apps. They can't like live on their own without their host app, like their phone app. And in this case, we're going to stick a watch app with filter. And I mean, generally, you're watch app and phone app should share some functionality. Like the watch app is more of an extension of the phone app and which should help and provide some convenience for some extra features that the user can perform using the watch. In Filterer's case, there's really not too much a watch app can do for you. We're going to do it here, anyways and we're going to show you how to build a watch app sort of stand alone. So the first thing you gotta do is go to File > New and here you're adding a Target. So quick introduction to targets. By default, your project has one target, which is your app. Your Filter app, but technic like that's not a limitation. You can have more than one target, you can actually have another iOS app. So you can just add another iOS target into your project. And now your one project can build two apps and then they can share the code, they can have different code. And you can say, setup say, you want to make one app, that's free within app purchases. And you have another app that's not free and it has everything a lot, you can use targets to do that. In this case, we could go to watchOS > Application. We're going to choose WatchKit App, which is by default is the latest for watchOS 2 and choose Next. So here, you put in the project name and you really you just create an app name for you watch app. So our post app our Filterer. So our watch app, we're going to call it some thing like FilterWatch. Pretty cool and we're auditioning, then we have to change but this should be the same or more or less the same as your setting your post app. In here, there states three options that we're not going to go through in this module. You have notifications, glances and complications. These are three sort of components you can have in your watch app that are optional. So you have the watch app itself, you have the notifications scene if you have notifications coming to your app, like push notifications. You have a glance scene, if you want to be able to include a glance that users can add onto their home screen. And also a complication, if you want to add a little complication that lives on the watch face. These are all very interesting, but once you know how to build a watch app, these are actually quite simple to implement and you go look into them yourself. So the project is going to be the same project as we have here and we're going to embed it in the companion application, Filterer. In this case, we only have one choice. because again, our project currently has one target. When you press Finish, you'll get this drop-down, asking you to activate this scheme. You're going to do that and what that does is actually add a scheme here. Before you only had one, which is the Filterer app. Now you have two, you have filter and FilterWatch. This means that if you build Filterer, you're building the phone app. But if you build FilterWatch, you're actually building the watch app. Now I will show what that does, we'll see what that does in a bit. And you also get two targets, so got more then you bargained for. You got one and one, you get two and also two more folder within your project matching the targets. So you have FiltererWatch, which includes Storyboard, very familiar. XE assets like a image assets thing and info.pls. So this is very by default now, you have an extension as well that includes interface controller. Like Taylor Swift source files in other assets and another info.pls list and these all work together to create your watch app and we're going to talk into the details of watch architecture and sort of how things are set up in the next lecture. So at this point, you're ready. You can actually build your watch app now. So when you choose it, look, it's kind of different. You have different simulators, because you now have a watch simulator. So I'm going to choose this one and if you just run, you'll build like normal. And instead, it'll bring up both simulators, because you'll remember that you need both the watch and the phone running for your app. And now you get this nice watch simulator, it'll load up. The watch simulator is sometimes a little bit flaky, like this. You do need to run it multiple times. If you have a real watch, this is a bigger problem. So, a few ways to debug this. So it gives you an error and actually, now it's running. So the watch, because it connects to your phone and in the simulator case next to your phone simulator. You're going to have to allow a few things and there's an app called a Watch. So often, when you build you might get errors. What you do if it's installed and we get any errors, you can come here to the Filter app and actually uninstall that from here and then it disappears, then you can install it again and then go back to Xcode and build again. The tools aren't perfect. Excellent isn't perfect, but it generally works most of the time. So now that I'm building, this is our watch app it's blank. We haven't done anything yet, but it's running on a simulated watch connected to your here, which is your simulated iPhone. So that's it for this lecture. See you soon.