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