1
00:00:07,940 --> 00:00:11,570
Hey hey hey everybody this is Caleb with Dev's Loeb's dot com.

2
00:00:11,570 --> 00:00:17,070
And in this awesome video we are going to request location services and I'm going to show you what is

3
00:00:17,070 --> 00:00:20,700
new in Iowa 11 forgetting the user's location.

4
00:00:20,700 --> 00:00:22,210
There are some things that have changed.

5
00:00:22,320 --> 00:00:26,280
Some things you need to know about that are really important to ensure that your app gets approved on

6
00:00:26,280 --> 00:00:27,170
the App Store.

7
00:00:27,480 --> 00:00:31,380
If you're using these skills for an app that you're going to release this one as well we're going to

8
00:00:31,380 --> 00:00:35,640
teach you best practices to make sure that you know what is new and what is up.

9
00:00:35,640 --> 00:00:42,510
So open your X called Project and let's get started requesting location services.

10
00:00:42,510 --> 00:00:48,900
So to do this we're going to need to go into Matt B.C and of course to get location we're going to need

11
00:00:48,900 --> 00:00:56,740
to import the Core Location frameworks so go ahead and type import Core Location and that looks great.

12
00:00:56,880 --> 00:01:03,020
And now what we need to do is we need to create an instance of a location manager.

13
00:01:03,150 --> 00:01:08,400
That's what we're going to use to manage locations of course see a location manager makes sense that

14
00:01:08,400 --> 00:01:09,910
it manages locations.

15
00:01:09,960 --> 00:01:18,120
So above view did load go Hedden type var location manager whip's capital M and we're going to set it

16
00:01:18,120 --> 00:01:23,830
to be equal to location manager and we're going to instantiate it from the get go.

17
00:01:23,830 --> 00:01:24,770
All right.

18
00:01:24,870 --> 00:01:30,060
Now similarly to our map view we need to also set the delegate of our location manager.

19
00:01:30,090 --> 00:01:35,090
So go ahead and type location manager delegate equals self.

20
00:01:35,420 --> 00:01:35,750
OK.

21
00:01:35,760 --> 00:01:41,910
And if you build and run this you'll notice it says cannot assign value of map b c to see a location

22
00:01:41,910 --> 00:01:43,250
manager delegate.

23
00:01:43,290 --> 00:01:48,430
The reason for that is because we have not conformed to it like we have MKM that you delegate.

24
00:01:48,480 --> 00:01:54,330
So go ahead and do that by creating another extension called extension Matthysse.

25
00:01:54,630 --> 00:02:01,670
And it's going to conform to C-L location manager delegate and give it some curly braces.

26
00:02:02,160 --> 00:02:05,850
So as soon as you do that you'll notice that the error goes away.

27
00:02:05,850 --> 00:02:12,590
This also means that there are no required methods to conform to C-L location manager delegate.

28
00:02:12,600 --> 00:02:19,320
Unlike you I table view or UI collection view there are some required methods that you conform to but

29
00:02:19,350 --> 00:02:21,760
there are none for unforeseen location manager or delegate.

30
00:02:21,840 --> 00:02:24,840
We're going to add some though so that we can actually have an app that works because you know that's

31
00:02:25,170 --> 00:02:26,810
important or whatever.

32
00:02:26,820 --> 00:02:28,570
Now it's totally important anyway.

33
00:02:28,590 --> 00:02:34,950
So in our extension we're going to use one of the given functions but we're also going to create one

34
00:02:34,950 --> 00:02:36,060
of our own.

35
00:02:36,120 --> 00:02:42,570
So we're going to go ahead and we're going to basically write a function of our own first called configure

36
00:02:43,590 --> 00:02:46,920
location services.

37
00:02:47,160 --> 00:02:54,420
And inside this function will give us some space here so we can see stuff awesome inside this function

38
00:02:54,420 --> 00:03:01,620
we're basically going to check to see is our app authorized to grab our location.

39
00:03:01,620 --> 00:03:05,430
If not it's going to go ahead and request those services.

40
00:03:05,580 --> 00:03:07,500
If it is it's just going to return.

41
00:03:07,630 --> 00:03:11,650
OK so it's a way to check to see if we are authorized to use our location.

42
00:03:12,360 --> 00:03:17,070
But you know what we need to actually create a variable that's going to keep track of our authorization

43
00:03:17,070 --> 00:03:17,780
status.

44
00:03:17,790 --> 00:03:21,470
So to do that go ahead it's actually going to be a constant.

45
00:03:21,510 --> 00:03:34,000
So go ahead and type let off though right zation status equals see Location Manager dot wups authorization.

46
00:03:34,500 --> 00:03:35,070
Okay.

47
00:03:35,250 --> 00:03:40,430
Sorry I can't type C-L location manager got authorization status.

48
00:03:40,580 --> 00:03:46,590
Option click on that you'll see this is a function from the location manager that returns C-L location

49
00:03:46,620 --> 00:03:48,120
authorization status.

50
00:03:48,220 --> 00:03:54,870
And if you pull that up in the help docs you'll notice that it is of type int 32 to number but basically

51
00:03:55,140 --> 00:03:59,690
these are constants that indicate whether the app is authorized to use location services.

52
00:03:59,790 --> 00:04:00,840
OK.

53
00:04:00,840 --> 00:04:07,140
So authorization status is there and it's going to be checking to see if authorized or not.

54
00:04:07,140 --> 00:04:15,030
So what we're going to do is we're first going to check to see if our authorization status is not determined.

55
00:04:15,030 --> 00:04:17,550
That's the name of one of the authorization statuses.

56
00:04:17,550 --> 00:04:22,270
So go ahead and type if authorization status is not determined.

57
00:04:22,290 --> 00:04:28,020
Meaning if the app doesn't know if it's approved or denied we're going to go ahead and we're going to

58
00:04:28,320 --> 00:04:30,440
call location manager.

59
00:04:30,440 --> 00:04:33,680
That request always authorization.

60
00:04:33,750 --> 00:04:39,480
This is going to request authorization so that our location is used always whether the app is open or

61
00:04:39,480 --> 00:04:40,130
not.

62
00:04:40,450 --> 00:04:48,840
OK then we're going to say else meaning if it is determined maybe it's denied maybe it's approved for

63
00:04:48,930 --> 00:04:54,150
when in use authorization we're going to go ahead and just return right because if we already are approved

64
00:04:54,150 --> 00:04:56,940
or already are denied there's no need to do anything else.

65
00:04:56,940 --> 00:04:58,280
We can just return.

66
00:04:58,320 --> 00:05:01,980
So that's how we're going to configure location services.

67
00:05:01,980 --> 00:05:02,860
All right.

68
00:05:02,940 --> 00:05:04,320
Very very cool.

69
00:05:04,320 --> 00:05:09,170
And now what we need to do is we need to call this function to run as soon as the view loads.

70
00:05:09,180 --> 00:05:11,960
So it's going to check to see if if we're good to go.

71
00:05:12,030 --> 00:05:17,220
So call it from view and load configure location services and let's go ahead and build and run it to

72
00:05:17,220 --> 00:05:18,710
see if it works.

73
00:05:18,720 --> 00:05:19,760
OK.

74
00:05:20,430 --> 00:05:21,890
Very cool.

75
00:05:21,900 --> 00:05:23,060
Where did we go.

76
00:05:23,070 --> 00:05:24,260
There it is.

77
00:05:24,300 --> 00:05:24,870
OK.

78
00:05:26,560 --> 00:05:30,040
And it looks like it's not working but check out the terminal here.

79
00:05:30,040 --> 00:05:39,190
It says the apps info dopiest must contain both and s location always and when in use usage description

80
00:05:39,940 --> 00:05:46,210
and N.S. location when in use usage description keys with string values explaining to the user how the

81
00:05:46,210 --> 00:05:48,120
app uses this data.

82
00:05:48,220 --> 00:05:52,930
Apple is huge on privacy so we've got to make sure we explain to the user exactly how we're using their

83
00:05:52,930 --> 00:05:53,920
data.

84
00:05:53,920 --> 00:05:59,160
So to do this go ahead and go to info up the list and down at the bottom if you hover over the bottom

85
00:05:59,230 --> 00:06:06,200
you see the plus and minus that pop up click on the plus and type privacy and then scroll down to find

86
00:06:06,200 --> 00:06:07,730
a location.

87
00:06:07,960 --> 00:06:10,400
And we're going to go ahead and we need to use location.

88
00:06:10,420 --> 00:06:16,110
Always use that description which I'll pull this open so you can see that location always usage description

89
00:06:16,870 --> 00:06:18,970
and do another one here.

90
00:06:19,170 --> 00:06:19,380
Click.

91
00:06:19,390 --> 00:06:22,220
Plus privacy location.

92
00:06:22,300 --> 00:06:24,940
When in use use usage description.

93
00:06:24,940 --> 00:06:30,690
And then furthermore we need another one and I actually copied it from here and that's location always

94
00:06:30,700 --> 00:06:33,100
and when in use your usage description.

95
00:06:33,100 --> 00:06:34,250
That's a mouthful.

96
00:06:34,300 --> 00:06:39,700
I'm going to copy that and paste that in here because in X code Bayda it's not yet working so you actually

97
00:06:39,700 --> 00:06:42,000
need to paste in this long name.

98
00:06:42,040 --> 00:06:44,100
It doesn't look nice and pretty like this.

99
00:06:44,110 --> 00:06:49,240
Now the thing is for all three of these we can use the same description but we need to use all three

100
00:06:49,240 --> 00:06:56,980
of them because in iOS 11 Apple has changed location services work instead of only showing when in use

101
00:06:57,040 --> 00:07:07,510
or always use or do not allow it forever it's basically been you can show one or the other or at different

102
00:07:07,510 --> 00:07:08,230
times.

103
00:07:08,230 --> 00:07:09,410
It's been a mess.

104
00:07:09,460 --> 00:07:13,090
But Apple is basically wanting their apps to be more user centric.

105
00:07:13,090 --> 00:07:17,080
The user is completely in control of how their data is used like it says.

106
00:07:17,080 --> 00:07:21,860
So when this pops up it's going to give the user three options when in use.

107
00:07:21,910 --> 00:07:27,820
Always in use or disallow instead of one or the other at different times based on the context so we're

108
00:07:27,820 --> 00:07:31,400
going to give the user the choice to decide which is kind of cool.

109
00:07:31,690 --> 00:07:43,810
So in order to do this we're going to say this app requires your location to pull photos from Flickr

110
00:07:43,870 --> 00:07:45,370
which we are using.

111
00:07:45,460 --> 00:07:51,000
We should put a period at the end of a sentence we are going to use that so go ahead and copy this.

112
00:07:51,100 --> 00:07:56,270
Paste it here and then paste it here for all three of these keys and values.

113
00:07:56,280 --> 00:07:58,080
OK we're going to just save it like that.

114
00:07:58,090 --> 00:08:03,480
And now that that's done we should be able to request authorization.

115
00:08:03,490 --> 00:08:06,130
So go ahead and build and run this one more time.

116
00:08:06,310 --> 00:08:11,770
Pull open your simulator and let's see if it requests our location suite.

117
00:08:11,770 --> 00:08:13,330
All right so it pulls it up.

118
00:08:13,360 --> 00:08:19,150
This is great and it gives us the choice only while using the app always allow or don't allow.

119
00:08:19,430 --> 00:08:24,250
I'm going to click always allow and as soon as you do that you'll notice my location pops up right there

120
00:08:24,250 --> 00:08:25,090
on the map.

121
00:08:25,090 --> 00:08:26,490
That's exactly what we wanted.

122
00:08:26,500 --> 00:08:31,240
But we're a little bit too far out here we can't really see anything that's going on on the map.

123
00:08:31,240 --> 00:08:35,260
So we need to actually write a function now that's going to zoom us in.

124
00:08:35,260 --> 00:08:40,210
OK we're going to call that center map on user location and basically what it's going to do is we're

125
00:08:40,210 --> 00:08:45,340
going to set a region that is about 1000 meters around where the user is and we're going to zoom the

126
00:08:45,340 --> 00:08:47,390
map in to show that whole region.

127
00:08:47,630 --> 00:08:48,700
OK pretty cool.

128
00:08:49,210 --> 00:08:54,100
So to do that we're going to actually write this function in M-K map view delegates and it has to do

129
00:08:54,100 --> 00:08:54,940
with the map view.

130
00:08:55,180 --> 00:09:05,070
And so let's do that let's write funk center map on user location give it some curly brackets there.

131
00:09:05,080 --> 00:09:06,370
That looks awesome.

132
00:09:06,700 --> 00:09:12,010
And now we're going to do in order to center this on the user's location is we're going to need to create

133
00:09:13,630 --> 00:09:15,910
a constant for the coordinate.

134
00:09:15,910 --> 00:09:16,350
Right.

135
00:09:16,360 --> 00:09:20,270
So on our map view there is a co-ordinate here where this pin has been dropped.

136
00:09:20,290 --> 00:09:25,900
The only issue is that sometimes the location manager might be a little bit slower or faster when the

137
00:09:25,900 --> 00:09:26,920
app opens.

138
00:09:26,950 --> 00:09:31,020
So we're actually going to safely create a constant using a guard.

139
00:09:31,080 --> 00:09:35,140
Let us make sure that there's a value of the coordinate.

140
00:09:35,140 --> 00:09:37,090
Otherwise it just returns.

141
00:09:37,150 --> 00:09:40,470
So if it doesn't work the first time it's going to just return.

142
00:09:40,480 --> 00:09:45,430
And then as soon as the map view starts updating the location we can call it a center which is pretty

143
00:09:45,430 --> 00:09:46,190
cool.

144
00:09:46,270 --> 00:09:49,510
So go ahead and type guard let it.

145
00:09:49,840 --> 00:09:56,170
And this is going to be equal to location manager and in the location manager we can get the location

146
00:09:56,350 --> 00:09:56,620
right.

147
00:09:56,620 --> 00:09:59,080
So that's where the blue dot is where it's showing up.

148
00:09:59,350 --> 00:10:01,520
And then we can get the coordinates from that.

149
00:10:01,820 --> 00:10:03,040
OK very cool.

150
00:10:03,040 --> 00:10:08,950
Now for a guard we need to put else at the end meaning if there is no value here what we're going to

151
00:10:08,950 --> 00:10:11,000
do happens inside these brackets.

152
00:10:11,050 --> 00:10:12,060
And we're just going to return.

153
00:10:12,070 --> 00:10:16,690
Meaning we're going to exit out of this function until it can be called later when there definitely

154
00:10:16,690 --> 00:10:17,560
is a value.

155
00:10:17,770 --> 00:10:20,270
OK so this is basically a guard lead.

156
00:10:20,320 --> 00:10:22,840
And this is a constant that we can use.

157
00:10:22,840 --> 00:10:29,390
So assuming there's a value assuming coordinate comes back something other than nyl we're going to create

158
00:10:29,420 --> 00:10:30,940
a coordinate region.

159
00:10:31,190 --> 00:10:39,110
So go ahead and type let coordinate region and this is going to be equal to M-K coordinate region which

160
00:10:39,110 --> 00:10:40,860
you can see right here.

161
00:10:40,970 --> 00:10:46,280
Now if I put a parentheses here you can see that a coordinate region has a center which hint hint it's

162
00:10:46,280 --> 00:10:49,350
going to be the blue dot and it has a span.

163
00:10:49,550 --> 00:10:54,540
So the center of course is going to be the coordinate as you would expect.

164
00:10:54,800 --> 00:10:56,420
And the M.K. coordinates span.

165
00:10:56,420 --> 00:11:03,290
If I press enter here and then option click you can see that this comes from map kit geometry and basically

166
00:11:03,590 --> 00:11:10,580
the span is where we're going to set how wide we want our region to be how big.

167
00:11:10,790 --> 00:11:16,190
And in order to keep track of that we're actually going to just set a constant of the radius that we

168
00:11:16,190 --> 00:11:18,020
want this region to be.

169
00:11:18,020 --> 00:11:21,030
And so what I'm going to do is actually appear at the tippy top.

170
00:11:21,050 --> 00:11:25,250
I'm going to go ahead and create a constant called region radius.

171
00:11:25,250 --> 00:11:31,820
Now bear in mind this needs to be of type double and we're going to set that to be equal to 1000 meaning

172
00:11:31,820 --> 00:11:33,830
1000 meters.

173
00:11:33,950 --> 00:11:37,990
That way we can set a region that is 1000 meters wide 1000 meters tall.

174
00:11:37,990 --> 00:11:41,120
We're basically creating a circle around our user.

175
00:11:41,180 --> 00:11:47,360
So with our region radius in place go ahead and scroll back down to M-K coordinates span and the M.K.

176
00:11:47,360 --> 00:11:52,670
coordinates span is going to basically allow us to set how far of a radius we want our map view to be.

177
00:11:52,670 --> 00:11:54,010
So go ahead.

178
00:11:54,350 --> 00:12:00,150
At the end of M-K coordinates spand type in net and you'll notice that there is.

179
00:12:00,470 --> 00:12:04,190
It's asking for a latitude Delta and a longitude Delta.

180
00:12:04,400 --> 00:12:04,670
OK.

181
00:12:04,690 --> 00:12:06,530
So let's go ahead and delete that.

182
00:12:06,740 --> 00:12:10,960
And now the latitude Delta is going to be the amount of change over the map.

183
00:12:10,970 --> 00:12:16,730
So we're going to have it basically go from one point plus a thousand k so we can just go ahead and

184
00:12:16,730 --> 00:12:24,020
type region radius OK and then we're going to do longitude delta of region radius as well.

185
00:12:24,290 --> 00:12:29,250
OK so that's cool our coordinate coordinate region is set.

186
00:12:29,270 --> 00:12:34,670
And now what we need to do is we need to basically just ask the map view to set that region type map

187
00:12:34,670 --> 00:12:42,410
view set region passen coordinate region and we want it to be animated.

188
00:12:42,470 --> 00:12:42,770
OK.

189
00:12:42,800 --> 00:12:43,990
Easy as that.

190
00:12:44,030 --> 00:12:45,850
So our co-ordinate region is now done.

191
00:12:45,860 --> 00:12:51,710
We're setting this region on our map view and this way it should be able to go ahead and zoom in nicely

192
00:12:51,710 --> 00:12:55,750
right to where the user is with about a 1000 meter radius around the user.

193
00:12:55,940 --> 00:13:00,810
So now we just need to know where to call this to center the map on the user's location.

194
00:13:00,830 --> 00:13:05,830
And that's actually going to be a part of C-L location manager delegate.

195
00:13:06,050 --> 00:13:12,860
So in order to do that we're going to call one of the built in functions called did change or wups I

196
00:13:12,860 --> 00:13:19,760
probably should call location manager and then let's type authorization did change.

197
00:13:19,760 --> 00:13:20,200
OK.

198
00:13:20,420 --> 00:13:28,130
So this function here did change authorization status is called any time the map view changes authorization.

199
00:13:28,130 --> 00:13:35,510
So with that in mind if suddenly our map view gets approved right if we approve when in use location

200
00:13:35,510 --> 00:13:42,890
services we want to center the map not the action center map on user location whenever we approve it.

201
00:13:42,910 --> 00:13:44,940
It's going to center on the user.

202
00:13:44,960 --> 00:13:50,660
And that's actually why we use the guard let when we press the authorization.

203
00:13:50,660 --> 00:13:55,970
If the map for some reason was not yet loaded it would try to zoom in and it would crash because it

204
00:13:55,970 --> 00:13:56,970
doesn't have a coordinate.

205
00:13:56,990 --> 00:14:01,850
But we use the guard left to return just in case we're being very safe programmers and that's one of

206
00:14:01,850 --> 00:14:04,860
the wonderful things about Swift is that you can do that.

207
00:14:04,880 --> 00:14:06,520
So let's build and run.

208
00:14:06,530 --> 00:14:11,660
Let's see if this actually does center properly like we want OK.

209
00:14:11,720 --> 00:14:12,180
There we go.

210
00:14:12,200 --> 00:14:12,630
Built.

211
00:14:12,650 --> 00:14:13,740
And let's take a look.

212
00:14:16,100 --> 00:14:20,480
How are we going to crash was is that it says invalid.

213
00:14:20,490 --> 00:14:22,300
Regents center.

214
00:14:22,650 --> 00:14:23,310
OK that's good.

215
00:14:23,310 --> 00:14:25,760
And the span is a thousand.

216
00:14:26,640 --> 00:14:28,340
Let's take a look why.

217
00:14:28,410 --> 00:14:30,130
Interesting.

218
00:14:30,210 --> 00:14:35,850
We have an M-K coordinate region and the span is good.

219
00:14:38,330 --> 00:14:43,170
OK let's you know what let's I think I know what's wrong.

220
00:14:43,170 --> 00:14:43,400
OK.

221
00:14:43,410 --> 00:14:44,750
M.K. coordinate region.

222
00:14:44,760 --> 00:14:47,880
There's another one called with make with distance.

223
00:14:47,880 --> 00:14:48,180
Yes.

224
00:14:48,180 --> 00:14:49,610
OK this is exactly right.

225
00:14:49,620 --> 00:14:52,600
Sorry guys I should have shown you this from the get go.

226
00:14:52,800 --> 00:15:00,240
M-K coordinate region make with distance allows you to use a distance length instead of a circular region.

227
00:15:00,240 --> 00:15:07,140
That's what I'm trying to do is to set a distance meaning a thousand meters in all directions longitudinally

228
00:15:07,230 --> 00:15:08,740
and latitudinal.

229
00:15:09,120 --> 00:15:10,990
I think those are real words anyway.

230
00:15:11,010 --> 00:15:15,060
So go ahead and pass in that coordinate coordinate.

231
00:15:15,660 --> 00:15:18,930
Sorry guys coordinate not the coordinate region.

232
00:15:18,930 --> 00:15:21,800
Now the latitudinal meters is going to be region radius.

233
00:15:21,810 --> 00:15:23,820
But remember this is just one way.

234
00:15:23,820 --> 00:15:29,160
So we actually need to multiply it by two in order to get 1000 meters on the left and the right side

235
00:15:29,160 --> 00:15:33,210
of us and then let's do that again for the distance the other way.

236
00:15:33,210 --> 00:15:35,600
Region radius times 2.0.

237
00:15:35,790 --> 00:15:42,510
Now we have a region radius going 1000 this way and that way and this way thousand that way north east

238
00:15:42,510 --> 00:15:45,030
south and west and all around.

239
00:15:45,030 --> 00:15:46,480
Let's try this one more time.

240
00:15:46,500 --> 00:15:49,080
Let's go ahead and build and run this.

241
00:15:49,290 --> 00:15:53,600
And let's check to see if it can properly set our region and zoom in.

242
00:15:57,100 --> 00:15:58,360
All right look at that.

243
00:15:58,360 --> 00:16:04,950
It centered us right on our little dot and we have about 1000 meters on either side top to bottom.

244
00:16:04,960 --> 00:16:07,710
That's our little radius here that we're paying attention to.

245
00:16:07,750 --> 00:16:09,010
Super super cool.

246
00:16:09,010 --> 00:16:11,090
Looks like it's zooming in perfectly.

247
00:16:11,140 --> 00:16:16,030
The only thing is we now need to set it so that this button when we click the center button it should

248
00:16:16,030 --> 00:16:18,640
center our location back down to the middle.

249
00:16:18,940 --> 00:16:20,350
That is the only thing.

250
00:16:20,530 --> 00:16:25,300
And to do that we're going to actually go into our Iby action we created Center Matt button was pressed

251
00:16:25,660 --> 00:16:29,320
and we're going to check against the authorization status just like we did before.

252
00:16:29,350 --> 00:16:38,710
So go ahead and type if Auth. status is equal to authorized always Or you can use the two straight straight

253
00:16:38,710 --> 00:16:39,130
slashes.

254
00:16:39,130 --> 00:16:45,560
I don't know what else to call them or authorization status is equal to when in use.

255
00:16:45,580 --> 00:16:50,510
So if it's authorized in any way we're going to go ahead and center the map on the user location.

256
00:16:50,710 --> 00:16:50,940
OK.

257
00:16:50,950 --> 00:16:55,310
Now let's try and build and run this and let's double check to make sure that that works.

258
00:16:55,320 --> 00:16:57,400
And then we're going to go ahead and move on to the next video.

259
00:16:58,980 --> 00:17:00,000
OK so we zoom in.

260
00:17:00,000 --> 00:17:01,220
That's lovely.

261
00:17:01,230 --> 00:17:02,550
Looks good.

262
00:17:02,550 --> 00:17:03,920
Let's go ahead and move the map.

263
00:17:03,930 --> 00:17:06,750
And if I clicked this it should zoom.

264
00:17:06,760 --> 00:17:07,640
Yeah there we go.

265
00:17:07,660 --> 00:17:08,280
OK it works.

266
00:17:08,280 --> 00:17:10,230
It zooms in Center us.

267
00:17:10,230 --> 00:17:15,000
You might be noticing this looks a little messed up and I think that's just because I'm using the iPhone

268
00:17:15,300 --> 00:17:20,310
6 or iPhone 7 plus and I'm a little bit zoomed out if I zoom in.

269
00:17:20,310 --> 00:17:22,080
It looks a lot better.

270
00:17:22,410 --> 00:17:27,600
So when I click it it animates and it zooms right to the center that's super super cool.

271
00:17:27,600 --> 00:17:29,710
All right so this works this is wonderful.

272
00:17:29,820 --> 00:17:33,780
In this video we have set it up so that we can get location services.

273
00:17:33,780 --> 00:17:38,290
We've given the user the power to choose always when in use or disallow.

274
00:17:38,490 --> 00:17:44,550
And we've also centered the map on the user's location using both a delegate method and the center map

275
00:17:44,550 --> 00:17:44,850
button.

276
00:17:44,850 --> 00:17:45,990
So very awesome.

277
00:17:46,140 --> 00:17:51,360
In the next video we're going to add a UI tap gesture recognizer so we can drop a pin exactly where

278
00:17:51,360 --> 00:17:53,510
we want on our map you see over there.
