1
00:00:05,930 --> 00:00:06,740
Hey what's up everyone.

2
00:00:06,740 --> 00:00:12,210
Mark Price you're at death's dot com and we're going to continue forward in our swoosh app.

3
00:00:12,350 --> 00:00:19,510
So far what we've done is we have built out segues so we can swap between screens we talked about a

4
00:00:19,520 --> 00:00:21,030
common error we had to fix it.

5
00:00:21,050 --> 00:00:24,560
And we actually just built all the designs and everything and so in this one let's actually create some

6
00:00:24,560 --> 00:00:30,530
logic with the buttons and learn how to pass data between View controllers which is a very important

7
00:00:30,530 --> 00:00:33,190
thing and we also get lots of questions about that as well too.

8
00:00:33,200 --> 00:00:39,710
And so you get to learn some core foundational stuff stuff and first things first.

9
00:00:39,710 --> 00:00:43,620
Don't let me go ahead and just do some good stuff.

10
00:00:43,700 --> 00:00:47,180
So I'm just going to get ad get commit which you should always be doing in your code.

11
00:00:47,300 --> 00:00:50,450
You don't need to follow this format here with all these different branches but you should always be

12
00:00:50,930 --> 00:00:53,360
using get and always adding and always committing.

13
00:00:53,360 --> 00:00:56,060
You will always use it in your job and pretty much everyone.

14
00:00:56,060 --> 00:01:03,280
Ninety nine percent of companies out there are using get nowadays so really important stuff for Lufa.

15
00:01:03,290 --> 00:01:04,650
All right so get commit dash.

16
00:01:04,680 --> 00:01:12,350
And what we did was we did segues programmatically programmatically.

17
00:01:12,350 --> 00:01:12,590
All right.

18
00:01:12,590 --> 00:01:13,140
Perfect.

19
00:01:13,280 --> 00:01:13,790
So you get.

20
00:01:13,790 --> 00:01:15,740
Check out dash Ashby.

21
00:01:15,950 --> 00:01:18,010
Let's actually push this pushes first get push.

22
00:01:18,050 --> 00:01:18,800
Origin.

23
00:01:18,860 --> 00:01:21,530
Lesson 0 8.

24
00:01:21,530 --> 00:01:25,700
When I push it to the origin it means it's pushing it to you know get help or bit bucket or whatever

25
00:01:25,760 --> 00:01:27,280
the remote origin is.

26
00:01:27,290 --> 00:01:30,270
So the code is there as well to now get check out.

27
00:01:30,280 --> 00:01:33,830
Ashby lesson 0 9.

28
00:01:34,070 --> 00:01:37,940
If you're wondering why the keyboard sounds a little bit different is because I just switch keyboards

29
00:01:37,940 --> 00:01:40,470
to cool razored gaming mechanical keyboard.

30
00:01:40,610 --> 00:01:44,140
And the reason why is Logitech keyboards absolutely suck.

31
00:01:44,180 --> 00:01:45,400
And they always stop working.

32
00:01:45,500 --> 00:01:48,970
And even though they look cool and they're quiet they stop working.

33
00:01:48,980 --> 00:01:50,790
And so these ones are very reliable.

34
00:01:50,930 --> 00:01:51,520
OK.

35
00:01:51,740 --> 00:01:53,200
All right with get out of the way here.

36
00:01:53,210 --> 00:01:55,860
Let's go ahead and open up our project.

37
00:01:56,030 --> 00:01:56,520
All right.

38
00:01:56,550 --> 00:01:58,460
We want this one right here.

39
00:01:58,540 --> 00:01:58,840
App.

40
00:01:58,880 --> 00:02:00,810
Swoosh.

41
00:02:01,010 --> 00:02:04,220
Great So here's our storyboards with our segues.

42
00:02:04,220 --> 00:02:08,280
And of course we can go back and forth between the different view controllers.

43
00:02:08,280 --> 00:02:10,640
And so let's talk about what we want to do.

44
00:02:10,670 --> 00:02:13,270
We've got a screen here so that we could get started.

45
00:02:13,310 --> 00:02:13,710
Go here.

46
00:02:13,710 --> 00:02:16,030
Now there's some logic that needs to happen.

47
00:02:16,040 --> 00:02:18,780
A user is going to select mens womens or coed.

48
00:02:18,950 --> 00:02:19,540
OK.

49
00:02:19,700 --> 00:02:25,750
And what needs to happen is before someone can actually go in and click the next button.

50
00:02:26,000 --> 00:02:26,580
OK.

51
00:02:26,720 --> 00:02:28,950
They should have to select one of these options here.

52
00:02:29,180 --> 00:02:36,830
And then once we get past this screen here we need get past the selected data over here to our skill

53
00:02:36,830 --> 00:02:40,040
Visi so we can then further enhance the choice.

54
00:02:40,040 --> 00:02:47,870
Whether you're a beginner or a baller and then finish and then basically if we had other screens you

55
00:02:47,870 --> 00:02:49,070
would do something with that data.

56
00:02:49,070 --> 00:02:52,670
So what we're going to do is we're going to learn how to store the data in the screen and then how to

57
00:02:52,670 --> 00:02:53,880
pass it on over here.

58
00:02:54,050 --> 00:02:58,980
And we also do some logic here with the next ball and so that it doesn't let you tap it unless there

59
00:02:58,990 --> 00:03:04,060
is the proper Rella data in place so let's go ahead and get started.

60
00:03:04,070 --> 00:03:08,330
First things first let's click this next button let's just disable it by default.

61
00:03:08,360 --> 00:03:11,630
So it can't it cannot be tapped on.

62
00:03:11,630 --> 00:03:13,160
So see this enabled button.

63
00:03:13,320 --> 00:03:14,360
We're going to do is turn it off.

64
00:03:14,360 --> 00:03:20,350
And what we'll do is when one of these options is selected we will then enable this button from code.

65
00:03:20,510 --> 00:03:21,300
OK.

66
00:03:21,620 --> 00:03:27,080
So in order to enable this from code we need to do is open up the assistant editor and make sure that

67
00:03:27,080 --> 00:03:30,300
we have an I.V. outlet available for this button.

68
00:03:30,290 --> 00:03:34,580
So even though we may have an I.V. action for our next tap We're also gonna need an IP outlet so we

69
00:03:34,580 --> 00:03:38,810
can actually grab or reference and make changes to it.

70
00:03:38,810 --> 00:03:44,860
So let's go ahead and control drag from the next button and leave it as an outlet and what we're going

71
00:03:44,860 --> 00:03:48,980
to do is call this next beat like so.

72
00:03:49,570 --> 00:03:50,180
OK.

73
00:03:50,470 --> 00:03:51,380
Very good.

74
00:03:51,760 --> 00:03:55,610
And you're going to notice when we work with ibl you're going to see this week a lot.

75
00:03:55,750 --> 00:03:56,180
OK.

76
00:03:56,230 --> 00:03:56,950
What does weak mean.

77
00:03:56,950 --> 00:04:00,710
Well it kind of means what you think it means you know you the strong and you get the weak.

78
00:04:00,760 --> 00:04:06,200
And in this case when it comes to coding and in time you make a variable of some kind.

79
00:04:06,200 --> 00:04:07,430
It's stored in memory.

80
00:04:07,510 --> 00:04:13,690
Ok has a memory address and then different parts of your program can access the memory they can access

81
00:04:13,690 --> 00:04:16,350
that slot in memory or the item that's there.

82
00:04:16,360 --> 00:04:23,000
Well what happens is when you put an object here in your view controller OK your view controller itself.

83
00:04:23,230 --> 00:04:26,980
OK here this intern here in the Interface Builder this view controller it's actually going to hold a

84
00:04:26,980 --> 00:04:28,090
reference to this button.

85
00:04:28,090 --> 00:04:34,450
So just by virtue of dragging a button on here this view controller the user interface element is going

86
00:04:34,450 --> 00:04:37,710
to hold a reference it's going to point to this button in memory.

87
00:04:37,720 --> 00:04:38,520
OK.

88
00:04:38,650 --> 00:04:41,620
So when we make an outlet we don't want to do that twice.

89
00:04:41,620 --> 00:04:46,750
We don't want our code to point to the same spot in memory and for the Interface Builder file to point

90
00:04:46,750 --> 00:04:50,700
to a memory because that's two different things holding on to it in memory.

91
00:04:50,740 --> 00:04:56,190
And so let's say and let's say that this controller screen goes off the screen and gets unloaded.

92
00:04:56,290 --> 00:05:00,610
You know if the code was still living we wouldn't want to reference it because it's no longer needed

93
00:05:00,700 --> 00:05:01,880
and vice versa.

94
00:05:01,990 --> 00:05:04,990
And it may be hard to understand you don't have to understand it completely right now.

95
00:05:05,320 --> 00:05:10,090
But the important thing to understand is that when you're working with IBM let's make sure your variables

96
00:05:10,150 --> 00:05:17,260
are weak so the UI and the code are not both referencing what we will do is mean and this view controllers

97
00:05:17,290 --> 00:05:18,790
unloaded out of memory.

98
00:05:18,940 --> 00:05:19,240
OK.

99
00:05:19,240 --> 00:05:21,080
It's a reference to this button will go away.

100
00:05:21,280 --> 00:05:24,010
And if this says weak this one will drop off as well too.

101
00:05:24,010 --> 00:05:26,140
Otherwise it would hold onto it and you could have a memory leak.

102
00:05:26,320 --> 00:05:31,180
You could have this button in memory even though the screen is not present to the user and it can no

103
00:05:31,180 --> 00:05:37,120
longer use that spot of memory and therefore your app can't be as powerful as it needs to be so a lot

104
00:05:37,120 --> 00:05:40,310
of information there make your ibl it's weak it's there by default.

105
00:05:40,360 --> 00:05:41,110
OK.

106
00:05:41,920 --> 00:05:45,790
So when the screen loads it will automatically be disabled because we said that in the interface builder

107
00:05:46,020 --> 00:05:50,560
and so the next thing I want to do is let's go ahead and set these Iby actions here.

108
00:05:50,740 --> 00:05:52,300
So we'll set one for Menz.

109
00:05:52,300 --> 00:06:04,440
So changes from outlet to action and we're say on mennes tapped same thing for women's on women's tab.

110
00:06:05,450 --> 00:06:14,860
And that was I already made a mistake or there was an I.V. outlet instead of instead of a b action and

111
00:06:15,010 --> 00:06:17,190
let's go ahead and change it to an action.

112
00:06:17,190 --> 00:06:21,470
And this must say on the women's tab.

113
00:06:21,690 --> 00:06:22,920
And one more for the code.

114
00:06:25,420 --> 00:06:35,810
Changes to an action and say on CO tab perfect what I'm gonna to use right click this league Visi and

115
00:06:35,830 --> 00:06:40,990
the document outline make sure that I get rid of this woman's tact because remember how I accidently

116
00:06:40,990 --> 00:06:43,570
made it an Ivy outlet and then I deleted it from the code.

117
00:06:43,600 --> 00:06:47,220
Remember every time you delete it from the code you have to go over here and delete it as well too.

118
00:06:47,260 --> 00:06:52,150
From the document outline an interface builder that would have in a crash or app and I just saved you

119
00:06:52,150 --> 00:06:53,200
from crashing your app.

120
00:06:53,410 --> 00:06:53,770
OK.

121
00:06:53,920 --> 00:06:57,280
Well it was my app and I'm scratching it but OK.

122
00:06:57,280 --> 00:06:58,280
So this is looking good.

123
00:06:58,360 --> 00:07:03,470
Let's go ahead and close the assistant editor and let's go into league visi.

124
00:07:03,910 --> 00:07:05,080
All right thinking aloud here.

125
00:07:05,080 --> 00:07:07,840
So the idea is a user comes to the screen.

126
00:07:08,050 --> 00:07:13,690
They select an option when they select an option the next button becomes enabled.

127
00:07:13,860 --> 00:07:14,410
OK.

128
00:07:14,410 --> 00:07:17,610
And then then they can move on to the next screen.

129
00:07:17,610 --> 00:07:18,710
So that sounds good to me.

130
00:07:18,820 --> 00:07:22,010
Let's just do some cleanup here.

131
00:07:22,060 --> 00:07:22,980
Cool.

132
00:07:23,020 --> 00:07:27,580
So the information how are we going to store it we're going to make it a very we'll pass it on.

133
00:07:27,580 --> 00:07:30,430
Well what I think we need to do is actually create a model.

134
00:07:30,430 --> 00:07:32,910
All right let's go to the model folder here.

135
00:07:32,950 --> 00:07:35,680
We're going to create a new model here called player.

136
00:07:35,690 --> 00:07:38,380
You're a player in the in the app.

137
00:07:38,380 --> 00:07:40,160
And there's different data that it's going to store.

138
00:07:40,270 --> 00:07:40,770
OK.

139
00:07:40,770 --> 00:07:42,500
So empty file is fine.

140
00:07:42,910 --> 00:07:47,950
Whenever you're creating model files or just data files with with just swift only stuff use a with file

141
00:07:47,950 --> 00:07:48,970
and import foundation.

142
00:07:48,970 --> 00:07:50,670
No need to import it.

143
00:07:51,010 --> 00:07:55,890
And what we're going to do is we're going to call this player.

144
00:07:57,010 --> 00:07:58,610
Okay great.

145
00:07:58,780 --> 00:08:03,950
And what we're can is we're in a create a struct and we're going to call this player which should use

146
00:08:03,950 --> 00:08:04,380
a struct.

147
00:08:04,400 --> 00:08:08,230
And when should use a class will always always always use a struct whenever you can.

148
00:08:08,240 --> 00:08:08,670
OK.

149
00:08:08,780 --> 00:08:13,710
So use a struct when using default swap type strings and things like that.

150
00:08:14,000 --> 00:08:18,040
Use a class when you have to do have to have custom things implemented.

151
00:08:18,090 --> 00:08:24,200
You know your own custom classes so that hold other classes or custom objects like that but a struct

152
00:08:25,040 --> 00:08:25,990
is a value type.

153
00:08:26,150 --> 00:08:26,590
OK.

154
00:08:26,660 --> 00:08:32,060
And so it can be copied over directly versus a class which is an object stored in memory and you can't

155
00:08:32,060 --> 00:08:33,170
copy it.

156
00:08:33,170 --> 00:08:38,200
And so use a struct whenever you can because they're faster much much faster so we're going to save

157
00:08:38,210 --> 00:08:41,670
our much faster than a class so far.

158
00:08:41,690 --> 00:08:42,660
And what do we want to do.

159
00:08:42,650 --> 00:08:44,540
We want to store the league.

160
00:08:44,540 --> 00:08:52,670
So let's just say selected well called desired league go because that's what I haven't named the image

161
00:08:52,670 --> 00:08:55,180
so desired league and we'll make it a string.

162
00:08:55,280 --> 00:08:56,800
So right now it's an empty string.

163
00:08:57,050 --> 00:08:58,130
OK.

164
00:08:58,310 --> 00:08:59,270
Or you know what.

165
00:08:59,510 --> 00:09:01,900
Let's just actually make it an optional.

166
00:09:02,030 --> 00:09:08,320
So we're going to say string optional Ambar and we're going to say the desired leagues and then there

167
00:09:08,340 --> 00:09:17,070
was the skill level so selected skill level and we'll call this a string as well to that's looking good

168
00:09:17,070 --> 00:09:17,660
there.

169
00:09:17,900 --> 00:09:18,140
OK.

170
00:09:18,150 --> 00:09:20,160
So desired leagues like the skill level.

171
00:09:20,160 --> 00:09:20,770
Cool.

172
00:09:20,860 --> 00:09:23,710
What we're going to do is here in our league.

173
00:09:23,720 --> 00:09:28,070
VC OK we're going to create a player will declare at the top.

174
00:09:28,530 --> 00:09:30,300
That's the keyword right there.

175
00:09:30,300 --> 00:09:35,100
Declare is when you declare a variable but not necessarily initialize it.

176
00:09:35,100 --> 00:09:41,150
So what we're going to do is we're going to say bar and then we're going to say player of type player

177
00:09:41,460 --> 00:09:47,260
and let's make this and implicitly unwrapped optional.

178
00:09:47,310 --> 00:09:53,040
And the reason why we want to make it implicit is because we don't want this code to even run unless

179
00:09:53,040 --> 00:09:53,900
there's a player.

180
00:09:54,060 --> 00:09:54,660
OK.

181
00:09:54,800 --> 00:10:00,650
And so we make it an option on what we can do is here in view to load all we have to do is initialized

182
00:10:00,650 --> 00:10:06,900
it we can say player equals player and that's how you initialize a struct with the two parentheses there

183
00:10:06,900 --> 00:10:07,940
like so.

184
00:10:07,950 --> 00:10:12,260
So when you did load occurs and it's going to create a new player.

185
00:10:12,300 --> 00:10:13,470
All right.

186
00:10:13,470 --> 00:10:18,150
And so what we have here is we've got a model that can store data and then eventually we'll pass this

187
00:10:18,150 --> 00:10:19,610
data onto another controller.

188
00:10:19,620 --> 00:10:22,000
But first let's go ahead and handle the logic.

189
00:10:22,050 --> 00:10:26,610
So on men's tapped on woman's tap uncoded tapped What do we need to do.

190
00:10:26,610 --> 00:10:31,590
All right well let's go ahead and write it out so when the men's button is tapped all we need to do

191
00:10:31,590 --> 00:10:38,740
is say player Daut desired league OK say equals minutes.

192
00:10:38,850 --> 00:10:39,040
All right.

193
00:10:39,040 --> 00:10:40,950
That's just a variable I'm creating.

194
00:10:40,980 --> 00:10:44,540
This is something that's going to let us know hey they selected the men's league.

195
00:10:44,650 --> 00:10:54,990
All right and here we can say player desirably equals women's all right in here player desired league

196
00:10:55,530 --> 00:10:56,920
equals coed.

197
00:10:57,270 --> 00:10:57,740
OK.

198
00:10:58,050 --> 00:10:59,590
So far so good.

199
00:10:59,610 --> 00:11:04,980
So when each of these buttons is tapped Let's go ahead and in this struct here let's set the variable

200
00:11:05,340 --> 00:11:07,630
of the desired league whatever it needs to be.

201
00:11:07,740 --> 00:11:13,970
And then of course in each one we want to enable that next button right so we say the next button that

202
00:11:14,820 --> 00:11:19,060
enables is enabled equals let's say true.

203
00:11:19,600 --> 00:11:20,080
OK.

204
00:11:20,880 --> 00:11:25,730
And you know we could copy this like so and like so.

205
00:11:26,310 --> 00:11:33,680
But what very important principle that I teach you that we are violating what Principal redialing we're

206
00:11:33,690 --> 00:11:36,510
violating the principal look at this next but next what next.

207
00:11:36,590 --> 00:11:41,490
And this the reason why we don't want repeat herself is because this could introduce logic errors like

208
00:11:41,490 --> 00:11:46,170
what if a programmer accidentally has or going through doing this three times or maybe 10 times they

209
00:11:46,170 --> 00:11:46,910
said false.

210
00:11:47,140 --> 00:11:49,730
They did autocomplete and like that false.

211
00:11:49,950 --> 00:11:52,510
And now there's a logic error so there's things like that that can happen.

212
00:11:52,530 --> 00:11:53,490
And so what we want to do.

213
00:11:53,520 --> 00:11:58,280
We just want to we want to clean this up a little bit we want to refactor make it mo better.

214
00:11:58,350 --> 00:12:03,780
So what we're going to do is right here I'm going to create a function here and we're going to call

215
00:12:05,130 --> 00:12:06,930
select League.

216
00:12:07,340 --> 00:12:07,880
OK.

217
00:12:08,100 --> 00:12:15,360
And for the parameters we want to pass in the league type so to say League type and this is going to

218
00:12:15,360 --> 00:12:16,380
be of type string.

219
00:12:17,370 --> 00:12:18,140
All right.

220
00:12:18,220 --> 00:12:20,360
And let's make our function here.

221
00:12:20,410 --> 00:12:22,220
I forgot to add the word function.

222
00:12:22,260 --> 00:12:23,200
There we go.

223
00:12:23,640 --> 00:12:24,460
OK.

224
00:12:25,110 --> 00:12:30,790
So there's the parameter and what we'll do here is we will say player desired league equals League type.

225
00:12:31,170 --> 00:12:36,600
OK so we're going to pass in the league type into this function and then it'll set it here and then

226
00:12:36,680 --> 00:12:41,960
waltz then we'll say the next button is enabled equals true.

227
00:12:42,210 --> 00:12:42,980
OK.

228
00:12:43,170 --> 00:12:53,190
And now what we can do is we can say select League Pass in men's K and then in this one something similar.

229
00:12:53,190 --> 00:12:55,810
Select league and pass in winnings.

230
00:12:56,470 --> 00:12:56,920
OK.

231
00:12:57,070 --> 00:12:59,620
And and this one will do the same thing.

232
00:12:59,820 --> 00:13:09,490
So select select league and we'll pass in the word co-head and let's clean this up

233
00:13:12,380 --> 00:13:13,520
school.

234
00:13:14,030 --> 00:13:18,370
And so now what we've done is we've we've clean this up a little bit so the next buttons only being

235
00:13:18,380 --> 00:13:21,580
set once and then these functions are passing in their various data.

236
00:13:21,590 --> 00:13:23,110
And this is what I was telling you about earlier.

237
00:13:23,120 --> 00:13:27,680
I try to never ever ever have logic built into Iby actions.

238
00:13:27,680 --> 00:13:28,100
OK.

239
00:13:28,160 --> 00:13:32,880
Logic's happening here and the actions just trigger what button was pressed.

240
00:13:32,880 --> 00:13:34,580
And how do we need to act accordingly.

241
00:13:34,670 --> 00:13:40,050
OK so what's happened so far is a user has tapped something and the Next button is now enabled.

242
00:13:40,190 --> 00:13:40,860
OK.

243
00:13:41,130 --> 00:13:45,320
One thing I do want to do though is I want to uncomment this just to make sure the next button doesn't

244
00:13:45,320 --> 00:13:48,530
even work without pressing one of these buttons.

245
00:13:48,530 --> 00:13:55,140
Let's go ahead and run the app and see OK our app has it loaded and what we want to do is click get

246
00:13:55,140 --> 00:13:55,860
started.

247
00:13:55,860 --> 00:13:57,840
And so this but should not work.

248
00:13:57,840 --> 00:13:59,710
Remember we wrote code to load the next screen.

249
00:13:59,730 --> 00:14:00,570
So when I clicked this.

250
00:14:00,600 --> 00:14:04,590
Nothing should happen and it's not so that's a good sign.

251
00:14:04,590 --> 00:14:10,150
Now what I want to do is uncomment this here and let's rerun the app.

252
00:14:10,820 --> 00:14:13,790
And what I want to do I guess I didn't need to combine to do it all.

253
00:14:13,820 --> 00:14:20,060
What I want to do now is when I select a a league then it lets me go to the next one so right now I

254
00:14:20,060 --> 00:14:26,780
can't do anything but when I click Menz for instance then we can go ahead and say next and boom there

255
00:14:26,780 --> 00:14:27,260
we have it.

256
00:14:27,260 --> 00:14:29,190
So that's looking really good right there.

257
00:14:29,220 --> 00:14:29,750
Cool.

258
00:14:31,240 --> 00:14:32,540
Making good progress.

259
00:14:32,590 --> 00:14:34,410
So so far so good.

260
00:14:34,420 --> 00:14:39,750
Let's talk about what we've done here is we've created IAB actions for the different buttons and we've

261
00:14:39,760 --> 00:14:43,830
created a function called select league where we pass in the league that was selected and then we dis

262
00:14:44,320 --> 00:14:48,950
enable the next button so they can go forward and then everything works as normal.

263
00:14:48,950 --> 00:14:50,490
We also created a struct here.

264
00:14:50,590 --> 00:14:54,050
OK we started building a model for application and you'll do this.

265
00:14:54,070 --> 00:14:55,090
OK.

266
00:14:55,480 --> 00:14:58,740
We might not have had to made a model meaning here in the welcome box.

267
00:14:58,950 --> 00:14:59,610
OK.

268
00:14:59,650 --> 00:15:05,950
Or excuse me in the league b c we could have made variables here we could have said our desired league

269
00:15:06,030 --> 00:15:07,730
of type you know type of string right.

270
00:15:07,740 --> 00:15:11,560
We could have done that and then one for the skill level and then we could pass those on to the next

271
00:15:11,740 --> 00:15:15,950
controller that starts becoming really nasty when you have multiple variables.

272
00:15:15,940 --> 00:15:19,170
Everything that you want to do in your apps you want to build around models.

273
00:15:19,190 --> 00:15:20,560
And so here's a protip.

274
00:15:20,810 --> 00:15:21,800
OK.

275
00:15:22,510 --> 00:15:27,210
Protip is if you haven't built a model in your app you're doing it wrong.

276
00:15:27,460 --> 00:15:33,640
Every piece of data that you need in your app should either be in a class or a struct it should be grouped

277
00:15:33,640 --> 00:15:34,020
together.

278
00:15:34,030 --> 00:15:41,260
So that's the protip all of the data in your app should always be always always always always be put

279
00:15:41,260 --> 00:15:42,830
into a struct or a class.

280
00:15:42,930 --> 00:15:43,400
OK.

281
00:15:43,540 --> 00:15:45,510
So that's why we created the player.

282
00:15:45,520 --> 00:15:46,270
It's reusable.

283
00:15:46,270 --> 00:15:47,440
It's testable.

284
00:15:47,440 --> 00:15:49,580
It's safer it's cleaner.

285
00:15:49,980 --> 00:15:52,490
No I do not want to code the project Stop.

286
00:15:52,840 --> 00:15:53,090
OK.

287
00:15:53,110 --> 00:15:54,910
So let's go ahead and call this video done.

288
00:15:54,910 --> 00:15:58,900
We've made some good progress here you've written some code started to build out some logic and in the

289
00:15:58,900 --> 00:16:03,760
next video what we'll do is we will learn how to pass data from one view controller to another so they

290
00:16:03,760 --> 00:16:05,160
can then operate on etc..

291
00:16:05,170 --> 00:16:05,830
So that's it for now.

292
00:16:05,830 --> 00:16:08,740
Mark Price at depth slopes dotcom move on forward.
