1
00:00:06,380 --> 00:00:07,370
Hey what's up guys.

2
00:00:07,370 --> 00:00:10,060
My name's Jacob Bloodsworth slopes dot com.

3
00:00:10,070 --> 00:00:15,440
And in our last lesson we got our map view all working and showing our current location.

4
00:00:15,440 --> 00:00:17,290
So that was really cool.

5
00:00:17,530 --> 00:00:25,490
And this one we're going to get that cool slider switch all hooked up so if you remember from our current

6
00:00:25,490 --> 00:00:34,790
run Visi we're going to make this you I am a you slide over and when it hits when it goes over the pause

7
00:00:34,790 --> 00:00:39,640
button will have it and the run and return back to the begin run visi.

8
00:00:39,680 --> 00:00:46,300
It's really cool and it's not too hard and it really adds you know a pretty sweet feature to the app.

9
00:00:46,340 --> 00:00:49,790
But before we get started let's open up our terminal.

10
00:00:49,790 --> 00:00:56,420
And like I said you don't have to always be making a new branch but you should definitely be committing

11
00:00:56,420 --> 00:00:58,490
all your changes and all that good stuff.

12
00:00:58,670 --> 00:01:04,040
So I'm going to create a new branch for this lesson lesson six

13
00:01:06,670 --> 00:01:06,990
right.

14
00:01:07,000 --> 00:01:09,040
And we're good to go.

15
00:01:09,220 --> 00:01:17,280
All right so we have our begin run Visi we have our run log Visi and then we have our location Visi

16
00:01:17,290 --> 00:01:26,370
that we're sharing between the begin run VC and the current run VC just so so we can share the same

17
00:01:26,370 --> 00:01:33,050
C-L location manager but we don't have a VC set up for this guy yet so let's go ahead and Right-Click

18
00:01:33,180 --> 00:01:42,150
our control or folder and his new file and go ahead and click on iOS Cocco touch class and we will name

19
00:01:42,150 --> 00:01:52,110
this current Ron VC All right make sure language Swift is selected.

20
00:01:52,160 --> 00:01:56,390
Make sure your target your project selected go ahead and create it.

21
00:01:56,570 --> 00:02:01,810
And we can delete all of this stuff and we don't need this common code here.

22
00:02:02,300 --> 00:02:12,890
And let's see now let's go back to our storyboard and we have to connect this Visi swift file to our

23
00:02:13,190 --> 00:02:14,210
storyboard.

24
00:02:14,390 --> 00:02:15,920
So open up your

25
00:02:18,700 --> 00:02:21,130
attributes inspector or I'm sorry.

26
00:02:21,490 --> 00:02:25,640
Identity inspector and right were custom classes.

27
00:02:25,660 --> 00:02:29,550
Pull that down and just find our current run we see that we just created.

28
00:02:29,890 --> 00:02:31,420
And now it's tied to that.

29
00:02:31,570 --> 00:02:34,060
And now we can hook up all of our IP outlets.

30
00:02:34,090 --> 00:02:35,570
So let's go ahead and do that.

31
00:02:35,590 --> 00:02:41,490
Open up the assistant editor and if it doesn't automatically open the VC we just connected.

32
00:02:41,490 --> 00:02:47,140
No big deal you can usually go to Automattic here and click on current run Visi or you can go through

33
00:02:47,230 --> 00:02:50,540
your whole project and find it manually.

34
00:02:51,340 --> 00:02:54,780
So once we have our VC up we can connect I.V. outlets.

35
00:02:54,820 --> 00:03:04,180
So we're going to have to connect our our background to the slaughter switch and also the UI image that's

36
00:03:04,180 --> 00:03:05,540
actually sliding.

37
00:03:05,680 --> 00:03:10,990
And the reason we're connecting the background is that we're going to be using that center location

38
00:03:10,990 --> 00:03:17,830
of that view to know where our slider is it's just easier than referencing the whole VC or like the

39
00:03:17,830 --> 00:03:26,500
background image Visi it makes a little easier as well for supporting other screen sizes and all that

40
00:03:26,500 --> 00:03:27,970
cool stuff.

41
00:03:28,000 --> 00:03:30,800
So let's go ahead and with the background.

42
00:03:31,180 --> 00:03:39,760
You I image you selected let's just control drag right above the view did load and we will call this

43
00:03:41,980 --> 00:03:43,310
background.

44
00:03:43,990 --> 00:03:46,870
Let's see what's a good name.

45
00:03:46,980 --> 00:03:56,410
We can just call this the Swype background image view.

46
00:03:57,020 --> 00:03:58,050
Right.

47
00:03:58,320 --> 00:04:03,760
And let's give it some space underneath and connect this round image view.

48
00:04:03,780 --> 00:04:11,520
So select that and just control drag right below the background one and we will call this the slider

49
00:04:11,970 --> 00:04:14,890
image view.

50
00:04:14,960 --> 00:04:15,910
All right great.

51
00:04:15,930 --> 00:04:20,640
We're not going to worry about the other ideologies at this time because we only care about the slider

52
00:04:20,640 --> 00:04:21,310
switch.

53
00:04:21,600 --> 00:04:28,290
So let's go ahead and close the assistant editor and open up our current run visi.

54
00:04:28,350 --> 00:04:31,950
So here's what we have a couple of things we're going to have to do.

55
00:04:31,950 --> 00:04:40,620
So we're going to need a pan a pan gesture recognizer attached to our slider image.

56
00:04:40,620 --> 00:04:46,770
We're also going to have to set the delegate for the pan the pan or the gesture recognizer.

57
00:04:46,770 --> 00:04:53,220
So with all that good stuff and then we're also going to have to create a a function that gets called

58
00:04:53,700 --> 00:04:57,860
when our gesture is being used.

59
00:04:57,870 --> 00:05:00,610
So with all that being said in view did low.

60
00:05:00,630 --> 00:05:03,800
Let's go ahead and create our Swype gesture.

61
00:05:03,910 --> 00:05:07,360
So we knew Let's see let swipe gesture

62
00:05:10,320 --> 00:05:10,710
OK.

63
00:05:10,710 --> 00:05:11,560
Sorry about that.

64
00:05:11,560 --> 00:05:16,350
Had to silence some of my devices so let's go ahead and make that swipe gesture.

65
00:05:16,360 --> 00:05:25,010
Let's swipe gesture equal you hi pan gesture recognizer.

66
00:05:25,750 --> 00:05:32,130
And we want this one where you can pass the target and selector in and the target is going to be self

67
00:05:33,190 --> 00:05:34,530
and the action.

68
00:05:34,540 --> 00:05:38,640
So we need to create a function that will get called.

69
00:05:39,040 --> 00:05:43,630
So we will just go ahead and pass and one will make in a second.

70
00:05:43,630 --> 00:05:50,200
So go ahead and hit the hash tag type selector and then open in parentheses.

71
00:05:50,210 --> 00:05:56,740
And now you would just pass in the function we're going to create and we'll call this the end run swipe

72
00:05:57,610 --> 00:06:00,440
and run swiped.

73
00:06:00,460 --> 00:06:02,470
So the end run was swiped.

74
00:06:02,470 --> 00:06:03,120
Right.

75
00:06:03,310 --> 00:06:12,130
And we need to pass in a sender and just do a call in there and then let's close all of our parentheses

76
00:06:12,130 --> 00:06:12,440
out.

77
00:06:12,490 --> 00:06:15,980
And that is our gesture created.

78
00:06:16,000 --> 00:06:19,600
And it's going to yell at us because this function does not exist.

79
00:06:19,600 --> 00:06:29,170
So if we go ahead and create that function right now just right underneath view did load go funk and

80
00:06:29,290 --> 00:06:31,180
run swiped.

81
00:06:31,480 --> 00:06:39,320
And we need to have a ascender variable and this is going to be of type UI hand gesture recognizer and

82
00:06:39,320 --> 00:06:43,100
then closing parentheses and opening and closing brackets.

83
00:06:43,120 --> 00:06:46,650
And there is our function.

84
00:06:47,230 --> 00:06:49,090
So far so good.

85
00:06:49,300 --> 00:06:57,130
And now we have to attach our gesture recognizer to our to our view.

86
00:06:57,130 --> 00:06:58,210
Right.

87
00:06:58,330 --> 00:07:01,940
So we want it on our slider image view.

88
00:07:01,960 --> 00:07:10,270
So if we call our slider image view and we say add gesture recognizer perfect and we just pass in the

89
00:07:10,300 --> 00:07:13,410
gesture we just create it just like that.

90
00:07:13,540 --> 00:07:18,330
And then we also want to enable user interaction.

91
00:07:18,340 --> 00:07:27,930
So slider image view enable OK is user interaction enabled and then we want to set that to true right.

92
00:07:27,940 --> 00:07:28,770
That's good.

93
00:07:28,780 --> 00:07:36,450
And now we need the gesture recognizer delegate attached to our swipe gesture.

94
00:07:36,670 --> 00:07:38,870
So go ahead and you swipe gestured.

95
00:07:39,040 --> 00:07:40,500
DELEGATE.

96
00:07:40,880 --> 00:07:41,400
OK.

97
00:07:41,410 --> 00:07:48,880
And then so we need to set this to self and cast it as a UI hand gesture recognizer.

98
00:07:48,940 --> 00:07:55,290
Delegate well you get not pand just gesture sir.

99
00:07:55,870 --> 00:08:04,920
There we go and that is done and I just forgot that we also want this current run VC to inherit from

100
00:08:04,950 --> 00:08:06,850
our location VC.

101
00:08:06,990 --> 00:08:09,930
So let's just erase the view controller.

102
00:08:09,930 --> 00:08:17,340
We don't want an inheritance from that and Pessin our location Visi perfect.

103
00:08:17,350 --> 00:08:24,380
Ok so now let's go down to our end run swiped selector that we created.

104
00:08:24,520 --> 00:08:34,230
And so we're going to be moving our slider image view but we're going to be comparing it to the background

105
00:08:34,290 --> 00:08:35,460
image view location.

106
00:08:35,460 --> 00:08:41,960
So we're going to do everything off the center of our Swype background image.

107
00:08:42,000 --> 00:08:47,040
So for that to work we're going to need a minimum and maximum offset because if everything goes off

108
00:08:47,040 --> 00:08:51,540
the center we need to know where the far left side is and the far right side is.

109
00:08:51,600 --> 00:09:03,240
So we're going to create a C.G. float for our minimum adjust and this is a C.G. float and we're going

110
00:09:03,240 --> 00:09:11,400
to set this to I don't know let's I'm guessing like 80 and we can always adjust that later.

111
00:09:11,400 --> 00:09:15,630
And it's basically going to be like when we slide it to the left side if it goes further and we want

112
00:09:15,630 --> 00:09:23,580
it or not far enough we'll change that number accordingly and then we'll also make a max of just C.G.

113
00:09:23,580 --> 00:09:30,780
float and we're going to make this one a little bigger because it's actually going outside of the view

114
00:09:30,780 --> 00:09:32,950
because that pause button is separate.

115
00:09:33,090 --> 00:09:37,710
So we'll start at like 130 and just We'll see if that's good it's it might be too much and might be

116
00:09:37,710 --> 00:09:39,340
too little.

117
00:09:39,390 --> 00:09:40,640
I'm not sure yet.

118
00:09:41,470 --> 00:09:42,300
Okay.

119
00:09:42,510 --> 00:09:43,700
And then we need to.

120
00:09:43,710 --> 00:09:50,420
So the sender being passed in we need to get a reference to that view.

121
00:09:50,430 --> 00:09:57,540
So that slider image view is the sender and we need to just set a variable to it and we'll just do that

122
00:09:57,540 --> 00:09:59,440
with an IF let.

123
00:09:59,700 --> 00:10:08,130
And this will be slider view equals sender view so we're setting the sender's view to a new variable

124
00:10:08,130 --> 00:10:13,340
called slider view are it an opening and closing brackets.

125
00:10:13,440 --> 00:10:17,340
And now we need to check for the state of our gesture.

126
00:10:17,340 --> 00:10:20,580
So there are a few like did the gesture begin.

127
00:10:20,580 --> 00:10:22,860
Did it change all that stuff.

128
00:10:22,860 --> 00:10:25,590
We want to just check for beginning and changing.

129
00:10:25,610 --> 00:10:26,150
OK.

130
00:10:26,310 --> 00:10:38,700
So if sender that state equals you I gesture recognizers state DOT began.

131
00:10:38,910 --> 00:10:39,240
OK.

132
00:10:39,270 --> 00:10:40,920
We want to know if it begins.

133
00:10:40,920 --> 00:10:44,310
We also or if the sender.

134
00:10:44,350 --> 00:10:47,090
That state equals you.

135
00:10:47,100 --> 00:10:56,170
I gesture recognizers state is equal to dot changed whoops changed.

136
00:10:56,570 --> 00:11:04,280
OK so every time that are just your recognizer has began or changed it will come into this if statement.

137
00:11:04,290 --> 00:11:04,850
OK.

138
00:11:05,010 --> 00:11:05,340
OK.

139
00:11:05,340 --> 00:11:13,410
So once it gets in here we'll have to check for the center of our slider view and we only care about

140
00:11:13,410 --> 00:11:18,490
the X location because we don't want it to move vertically in our and our Visi right.

141
00:11:18,570 --> 00:11:20,680
We're just sliding left and right.

142
00:11:20,940 --> 00:11:28,980
So we need to check to see if our view is within the minimum and maximum range to move it right.

143
00:11:29,190 --> 00:11:38,490
So let's go ahead and say if slider view dot center so the center so the center of our slider view image

144
00:11:38,600 --> 00:11:48,070
that X we only care about the x coordinate we want to know if it's greater than or equal to our are

145
00:11:50,020 --> 00:11:59,440
what we call our Swype background or Swype background image view data center that X we want to know

146
00:11:59,440 --> 00:12:02,430
if it's greater than arm far.

147
00:12:02,710 --> 00:12:08,120
Basically right now we're just seeing if it is greater than the center of our background image which

148
00:12:08,260 --> 00:12:11,350
obviously it's not going to be because it's to the left of it.

149
00:12:11,380 --> 00:12:19,090
So now we subtract our minimum adjust and so that is going to just check to make sure it's greater than

150
00:12:19,300 --> 00:12:20,830
the minimum we just set on it.

151
00:12:20,830 --> 00:12:25,870
So if it is greater than that it's going to allow us to enter this function.

152
00:12:25,870 --> 00:12:28,490
So we also want to make sure so do.

153
00:12:28,540 --> 00:12:40,540
And we also want to make sure that the wider view sensor that X is less than or equal to the Swype background

154
00:12:40,570 --> 00:12:45,440
image center that X plus Max adjust.

155
00:12:45,850 --> 00:12:51,220
So this is just making sure it's not further then as far as we want it to go on the right side.

156
00:12:51,220 --> 00:12:51,770
Right.

157
00:12:51,820 --> 00:13:00,370
So if it's between our two points that we want our slider image to be we will then set the center to

158
00:13:00,370 --> 00:13:06,140
our slider image to a new point and that will allow it to move.

159
00:13:06,700 --> 00:13:09,390
So now let's do our slider view.

160
00:13:10,670 --> 00:13:13,900
Data Center equals.

161
00:13:14,020 --> 00:13:16,800
This is a C.G. point.

162
00:13:16,990 --> 00:13:19,840
So we had to adjust the X and the Y.

163
00:13:20,440 --> 00:13:22,110
So go ahead and do that.

164
00:13:22,120 --> 00:13:27,850
And it is the C-g float and our x value is going to be

165
00:13:31,300 --> 00:13:41,500
the current center of our slider view that X plus the the translation and the translation is basically

166
00:13:42,190 --> 00:13:44,220
wherever your finger is when you slide it.

167
00:13:44,260 --> 00:13:47,620
It's going to add or subtract the difference from that point.

168
00:13:47,950 --> 00:13:53,860
And I just realized we actually forgot to set our translation but it's super easy.

169
00:13:53,860 --> 00:13:58,230
So let's see right underneath the if statement here.

170
00:13:58,240 --> 00:14:11,820
If it changed let's go ahead and just say let translation equal sender dot translation of self view

171
00:14:14,490 --> 00:14:14,930
OK.

172
00:14:14,940 --> 00:14:20,850
And that gives us the translation of you know the senator being passed in.

173
00:14:20,850 --> 00:14:25,620
And so the translation is just literally how many points we're adding or subtracting from the current

174
00:14:25,620 --> 00:14:26,890
location.

175
00:14:26,910 --> 00:14:30,010
So now we can just take our X location.

176
00:14:30,060 --> 00:14:39,430
So that's our slider view center dot X and add the translation dot next.

177
00:14:39,930 --> 00:14:45,900
And so that'll take care of if it's negative or positive it will just set that and our Y location we

178
00:14:45,900 --> 00:14:52,680
don't want to change so we're just going to send in our slider view center Y and nothing nothing needs

179
00:14:52,680 --> 00:14:53,900
to change.

180
00:14:54,370 --> 00:14:59,110
So OK so if our point is between these two points we can move it around.

181
00:14:59,310 --> 00:15:02,910
And I'm I'm pretty sure that's all we need.

182
00:15:02,910 --> 00:15:03,660
We just have to.

183
00:15:03,710 --> 00:15:03,960
OK.

184
00:15:03,990 --> 00:15:05,290
So right here.

185
00:15:06,340 --> 00:15:14,310
Is Outside of this if statement but inside of the gesture recognizer if it began or changed we just

186
00:15:14,310 --> 00:15:26,710
need to now do sender dot set translation and you're going to pass an R C G C C G point zero.

187
00:15:27,120 --> 00:15:36,180
And we want to just pass in our view and that would just be self view all right.

188
00:15:36,200 --> 00:15:36,560
Cool.

189
00:15:36,590 --> 00:15:46,390
So now if we run this we should be able to move our slider image view back and forth OK let's start

190
00:15:46,390 --> 00:15:51,360
our run and look at that we can drag this back and forth.

191
00:15:51,630 --> 00:15:53,100
It got stuck here.

192
00:15:53,290 --> 00:15:54,910
So we'll have to do some adjustments.

193
00:15:54,910 --> 00:16:01,420
And did you also notice that the slider was behind the end run so we'll also have to fix that.

194
00:16:01,420 --> 00:16:03,040
So let's go into our storyboard.

195
00:16:04,930 --> 00:16:14,350
And open up the tree here and now our slider image needs to just be on the other side underneath the

196
00:16:14,350 --> 00:16:17,610
end run label and that will take care of that.

197
00:16:17,710 --> 00:16:24,490
And then if we go back to our current run see less than or equal to

198
00:16:28,660 --> 00:16:29,410
our Max.

199
00:16:29,450 --> 00:16:30,180
Just

200
00:16:38,380 --> 00:16:38,950
OK.

201
00:16:38,990 --> 00:16:47,510
I think this is OK for now so what we're going to have to do is if it does hit the max area or it goes

202
00:16:47,510 --> 00:16:52,940
above the max area we want to set the slider view center to the max so we can still continue to move

203
00:16:52,940 --> 00:16:53,050
it.

204
00:16:53,060 --> 00:16:58,880
Otherwise like when it got stuck it got outside of a max area and then obviously it doesn't answer the

205
00:16:58,970 --> 00:17:00,160
if statement anymore.

206
00:17:00,290 --> 00:17:05,540
And we're also going to do the same thing for minimum so if it goes to the minimum point or further

207
00:17:05,810 --> 00:17:08,380
we want to just set it to the minimum point.

208
00:17:08,420 --> 00:17:09,020
OK.

209
00:17:09,260 --> 00:17:21,170
So let's go ahead and do an else here and we want to else if slider view center x is greater than or

210
00:17:21,230 --> 00:17:31,560
equal to our Swype background image view center that X plus the max and just

211
00:17:34,510 --> 00:17:39,490
and like us the far right place so we're just kind of off center in the center.

212
00:17:39,490 --> 00:17:47,930
So if it's greater than this we want to just make sure we set the center to that.

213
00:17:48,190 --> 00:17:55,660
So take our slider view data center dot X and we want to just set this to C-g point

214
00:17:58,860 --> 00:18:03,760
or we can just center not we don't need a C.G. point.

215
00:18:03,760 --> 00:18:13,420
We will just do our Swype background view data center and X plus the maksud just and that will take

216
00:18:13,420 --> 00:18:16,810
care of that.

217
00:18:16,830 --> 00:18:17,190
All right.

218
00:18:17,190 --> 00:18:18,100
Cool.

219
00:18:18,150 --> 00:18:22,780
You know we don't even have to do this C-g point stuff here either.

220
00:18:22,800 --> 00:18:26,400
Why don't we just do slider image center dot X

221
00:18:29,130 --> 00:18:42,600
and we'll do the same thing we'll just do slider view dot center dot X plus the translation dot X and

222
00:18:42,600 --> 00:18:44,910
that should accomplish the same thing.

223
00:18:45,240 --> 00:18:51,650
And then so after this so if it's greater than our max point we set it to the max point.

224
00:18:51,810 --> 00:18:56,230
And then lastly else this would just be if it's minimum right.

225
00:18:56,250 --> 00:19:03,820
We just set our slider view center dot X equals the Swype image background or background image view

226
00:19:04,040 --> 00:19:09,150
center X minus our minimum.

227
00:19:09,160 --> 00:19:09,830
Just

228
00:19:12,350 --> 00:19:14,080
and that should do it.

229
00:19:14,240 --> 00:19:29,720
So now if we run this we should build a slide back and forth.

230
00:19:29,730 --> 00:19:33,080
All right let's try it out like that.

231
00:19:33,420 --> 00:19:35,640
So yeah we can slide it back and forth.

232
00:19:36,620 --> 00:19:40,000
This is awesome and it actually looks like this is kind of where we want it.

233
00:19:40,160 --> 00:19:47,420
So if this went farther than over like over here or like not close enough we would just adjust the minimum

234
00:19:47,540 --> 00:19:48,560
adjustment.

235
00:19:48,560 --> 00:19:55,730
So it's 80 right now so you can make it 85 90 70 whatever you need like all of our screens are probably

236
00:19:55,730 --> 00:19:56,740
a little different.

237
00:19:56,960 --> 00:20:00,670
So you guys might have to change it and notice it's in front of the end run now.

238
00:20:01,460 --> 00:20:06,870
And I think it probably goes a little further than we want it so let's adjust that one.

239
00:20:07,280 --> 00:20:08,780
So it's a little off center.

240
00:20:08,810 --> 00:20:14,770
Let's go ahead and stop this and let's just make this like one.

241
00:20:14,830 --> 00:20:26,550
Twenty one twenty six is probably too much but let's just say OK so click Start Run and let's see.

242
00:20:27,100 --> 00:20:34,390
Yes it's a little too much so I think that's all right let's just do like 128 and we'll call it a day.

243
00:20:34,390 --> 00:20:37,040
Save your project and.

244
00:20:37,120 --> 00:20:37,450
All right.

245
00:20:37,450 --> 00:20:43,920
So now there's a few things we need to do when it hits the max adjust we want the run to end right.

246
00:20:43,960 --> 00:20:53,050
So underneath here we can we're going to add some code so and run code goes here.

247
00:20:53,110 --> 00:20:55,370
So whatever we use to end our run later.

248
00:20:55,440 --> 00:21:02,920
And we also want to dismiss the the VC right so dismiss animated.

249
00:21:02,920 --> 00:21:05,620
True yes completion handle or nil.

250
00:21:05,620 --> 00:21:06,760
We don't need that.

251
00:21:06,760 --> 00:21:12,250
So calling this will now dismiss our view and we'll go back to the main the main view which is really

252
00:21:12,250 --> 00:21:18,520
cool and we don't want anything to happen on the minimum view so that's good.

253
00:21:18,670 --> 00:21:21,500
But what we do want let's run this again.

254
00:21:24,420 --> 00:21:28,810
We want when we let go of this at any point we wanted to animate.

255
00:21:28,800 --> 00:21:30,720
And back to the beginning right.

256
00:21:30,960 --> 00:21:32,410
Let's make sure and our exit work.

257
00:21:32,410 --> 00:21:33,890
So that's really cool.

258
00:21:33,900 --> 00:21:43,970
So what we want is if the sender state hasn't began or changed we want to do an else here.

259
00:21:44,550 --> 00:21:45,060
Let's see.

260
00:21:45,060 --> 00:21:46,390
Else we'll do it.

261
00:21:46,410 --> 00:21:47,440
Else if.

262
00:21:47,670 --> 00:21:52,460
And then we want to check the sender state again.

263
00:21:52,860 --> 00:21:59,390
And if it's equal to you I gesture or state that ended.

264
00:21:59,500 --> 00:21:59,810
All right.

265
00:21:59,820 --> 00:22:06,510
So if it ended if we stopped using the gesture recognizer we want to then animate our view back to the

266
00:22:06,510 --> 00:22:11,910
beginning right and doing the animation super easy we can just do a UI view

267
00:22:14,370 --> 00:22:20,580
animate with duration and let's you ration

268
00:22:23,270 --> 00:22:24,890
completion the way

269
00:22:39,460 --> 00:22:43,690
time interval with duration I guess this one is great.

270
00:22:43,690 --> 00:22:50,540
So with duration let's set it till like point 1 we want it to go really quick.

271
00:22:51,010 --> 00:23:01,850
And then inside of this code it will just set our slider view center to the minimum just right.

272
00:23:01,850 --> 00:23:13,010
So we will just do slider view center X equals Swype background view data center that X minus minimum

273
00:23:13,030 --> 00:23:18,140
adjust and let's run this and see if it worked.

274
00:23:18,540 --> 00:23:20,730
We got all that one second.

275
00:23:21,480 --> 00:23:27,740
Requires self oh we just need to do self because we're inside a completion handler

276
00:23:32,000 --> 00:23:34,340
and let's run it.

277
00:23:34,340 --> 00:23:34,720
Now

278
00:23:39,280 --> 00:23:43,120
all prying itself on the slider views well maybe not.

279
00:23:43,270 --> 00:23:46,310
OK let's start it.

280
00:23:46,330 --> 00:23:48,540
And now if I'm dragging and let go look at that.

281
00:23:48,560 --> 00:23:50,180
It shifts back to the left.

282
00:23:50,210 --> 00:23:52,970
Pretty cool so we just made our own custom slider.

283
00:23:53,120 --> 00:23:53,890
That's great.

284
00:23:53,890 --> 00:23:54,560
That's awesome.

285
00:23:54,560 --> 00:23:56,570
So we're going to call this lesson done.

286
00:23:56,750 --> 00:24:06,860
But before we do let's pull up our terminal and do it get ad period get commit Dasch am and we we set

287
00:24:06,860 --> 00:24:12,020
up our custom slider's switch.

288
00:24:12,020 --> 00:24:13,170
Good work guys.

289
00:24:13,340 --> 00:24:14,470
Awesome.

290
00:24:14,480 --> 00:24:14,750
All right.

291
00:24:14,750 --> 00:24:16,000
So we are done with that.

292
00:24:16,010 --> 00:24:23,330
And in the next lesson we'll finish getting all these labels and Iby outlets hooked up and start working

293
00:24:23,330 --> 00:24:30,350
on the awesome awesome stuff behind just tracking the runner's location.

294
00:24:30,590 --> 00:24:33,110
How we find the pace and distance that's really cool.

295
00:24:33,110 --> 00:24:34,470
So I'll see you guys in the next lesson.
