All right. 1
So the first thing that we're going to do is we're going to clone an existing Xcode project from GitHub. 2
Now, 3
firstly, what is GitHub? 4
Well, it's a really, really popular service that developers use to upload their code to be able to share 5
their code with other developers and also manage their programming projects. 6
If you head over to github.com, you can find out a bit more about what it does. 7
And the reason we're using it is because you now know how to create image assets, drag and drop them 8
into your assets folder. 9
We want to spend more time learning and less time doing rote tasks. 10
So we've done all of those things for you already. 11
We've created the image assets. 12
We've added it into a skeleton Xcode project. 13
Now, for you to be able to get access to it, we're going to share it with you using GitHub. And GitHub 14
is one of mine and probably loads of other developers' favorite tools. 15
And it was recently acquired by Microsoft for over $7 billion. That just goes to show just 16
how important it is to the development community. 17
So how do we get access to the skeleton project? 18
Well, as always, it's going to be a trip to the iOS course resources which, hopefully, you've already got 19
bookmarked. 20
And if you head over to the Dicee Module, and then go ahead and click on the Dicee Starting Project, then 21
it will take you to a page on GitHub which hosts the starting file. 22
So this is what it looks like. 23
And you can read a little bit about our goal, what we'll create, what you'll learn. 24
But the most important part is the code that's in here. 25
And the code is spread out over a number of folders and these are the folders that you've already seen 26
in your previous Xcode projects. 27
But we don't want to share a single file by file. 28
We don't want to use things like Dropbox to share these things because code changes constantly. 29
And this is one of the most efficient tools of managing that complexity. 30
So how do we clone an existing project? 31
So we've got this iOS13 at Dicee Starting Project. 32
I want you to go ahead and click on this Clone or download button, and then you can click on this button 33
which copies the link to this project. 34
Now, note that this link is not the same as this. 35
This refers to the actual project whereas this is the page where the project is hosted on. 36
So if we go ahead and copy that, then we can go back into Xcode. If you have any projects that are currently 37
open in Xcode, 38
I recommend you to go ahead and close them all down by clicking on this button. 39
Don't worry, everything in Xcode is automatically saved every few seconds, 40
so you don't even have to hit save for that to happen. 41
It's very, very rare that you end up losing work in Xcode. Once that's closed, 42
then I want you to head over to source control and click on Clone. 43
Alternatively, if you've just open up Xcode and you see the welcome screen, then you'll also click on 44
this Clone an existing project link as well. 45
So both of these buttons do exactly the same thing. 46
They take you to a place which allows you to paste that URL that you copied over just now into 47
the search bar. 48
Now, don't worry if you don't see anything in here in this window. This is because I have a GitHub account 49
and it's logged in and tracking all the things that I viewed and used. 50
But you don't even need to sign up to GitHub or have a GitHub account to be able to clone these projects. 51
You simply need to paste that link you got from over here and then click Clone and it will take anywhere 52
from a few seconds to a few minutes depending on your network connection for it to be able to download 53
that project file. 54
Now, it's going to ask you to choose where you want to save it. 55
And I'm gonna put it inside my Development folder inside desktop just as I've done previously. And I'm 56
going to save it as the same name as the original file which is Dicee iOS13. 57
But feel free to modify this as you wish. You can delete the iOS13 or change its name if you 58
want. 59
Just know where you've saved it and what you've called it so you can find it later on. 60
So now click Clone and once it's done cloning, you should see the Dicee Starting Project. 61
This is the Read Me that you saw previously on GitHub. And in the project navigator, you can see all of 62
our familiar files. 63
If you take a look inside Main.storyboard, you'll be pleased to discover that there's absolutely nothing 64
that we've done here for you. 65
I think it's still a good idea at this stage to practice creating more of the User Interface. 66
But if you have a look inside the Assets folder, you can see we've already created all of the app icons 67
and all of the various image files, so you don't have to download anything or drop it in either. 68
If you take a look inside the launch screen, we've already created a launch screen. 69
So if you run the app as it is, you'll see the launch screen briefly flash up for a moment. 70
Remember, this is a place where you normally have your company logo or your game development studio name, 71
whatever it may be, or your own name in fact, or maybe an inspirational group. But it simply shows up for 72
a few seconds. And there it is. You saw it for a flash. And now it's launched the Main.storyboard which 73
is, of course, a blank screen. 74
Now, you are ready to get started and work on this skeleton project without having to download image 75
files, drag and drop them in, and we can spend more time learning about the meat of iOS developments. 76
For the final part of this lesson, 77
let me show you the true power of being able to clone projects from GitHub because you'll be using 78
it for more than just cloning the skeleton projects and checking out the completed code. 79
There are loads of other cool open-source projects that you can clone and run. 80
So for example, if you search for open-source iOS apps in GitHub, you'll find lists such as this one where, 81
for example, you can find the Firefox iOS app which is built in Swift. 82
So this is the actual Firefox app and it's obviously very, very complicated for where we are right now. 83
But there's also some other cool projects, too. 84
And as you develop your skills in Swift, you'll be able to use these projects to inspire you and to 85
be able to see how other people code. 86
Now, one of my favorite projects is the Flappy Bird that's implemented in Swift. 87
Here's a challenge for you. 88
I want you to clone this Flappy Swift project to your local Xcode and to run the app to be able to 89
play Flappy Bird in the simulator or on an iOS device. 90
So you should already know how to do all of this. 91
So go ahead complete the challenge and have some fun. So that's gonna be super simple. 92
We're going to copy the link and then we're going to go into Xcode, and we're going to clone this project 93
right here and I'm gonna hit clone. And then I'm going to simply save it in my download because I'm not 94
going to keep it around for very long. And once it's done, I'm simply gonna run it in my simulator. 95
And I recommend to only run it on the simulator. Because if you want to run it on a physical device, then 96
you'll have to go into signing capabilities to your team and also change the bundle identifier to something 97
completely unique, so that it doesn't correspond to anybody else's version of this app. 98
But, again, this code came from the Internet, 99
so I recommend to only run it on the simulator instead of an actual device. 100
So now I've got Flappy Bird running and you can play a version of Flappy Bird. 101
Now I'm really bad at Flappy Bird. 102
So this is gonna be a really short demo of my gameplay. 103
But if you want to explore more open-source iOS apps, 104
there's a really good collection on GitHub by this guy, 105
dkhemsing, 106
not sure how that's pronounced. But if you scroll down, you can see there's loads and loads 107
of different things that they've collected for different platforms, say, Apple TV or Apple Watch projects, 108
and this is a really fun place to browse through clone. 109
And as we get more skilled with iOS, we'll be able to understand more of the code that's in these sample 110
projects and be able to learn from them as well. 111
That's all for this lesson. In the next lesson, 112
we're going to continue building out our Dicee app and we're going to be designing the User Interface. 113
So for all of that and more, 114
I'll see you there.