Ya know the little location button in the lower-left corner of the Maps application? Does anybody know where I can find that? I looked in UIButtonType and UITabBarSystemItem but came up blank.
I'd prefer to use a system image or a system something-or-other, to help ensure consistency with other system functions.
Here's how: Go to Settings > Privacy, then select Location Services. Select an app, then turn Precise Location on or off.
Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.
Step 1: First, open the setting and go to the 'Privacy' option. Step 2: Then tap the 'Location Services' option. Step 3: Then scroll down to the list of app and then select 'System Services'. Step 4: Now you will see a list of system services on the screen and then scroll down and toggle of the 'Status bar' option.
Have a look at https://github.com/myell0w/MTLocation
I mimiced Google Maps' Locate Me - Button, including 4 different states and the animation that is done when switching between states.
You can try using MKUserTrackingBarButtonItem It provides the same functionality as the track button on the Map app. Here is some same code.
MKUserTrackingBarButtonItem *trackButton = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];
NSMutableArray *items = [[NSMutableArray alloc] initWithArray:self.bottomToolbar.items];
[items insertObject:trackButton atIndex:0];
[self.bottomToolbar setItems:items];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With