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