Show user's location on the maps#5
Open
ChrisMash wants to merge 2 commits intodigidol:json_data_sourcefrom
Open
Show user's location on the maps#5ChrisMash wants to merge 2 commits intodigidol:json_data_sourcefrom
ChrisMash wants to merge 2 commits intodigidol:json_data_sourcefrom
Conversation
ChrisMash
commented
Sep 8, 2022
| return | ||
| } | ||
|
|
||
| let locations = locationTypes[indexPath.row].locations |
Author
There was a problem hiding this comment.
The above two line changes relate to when there's no data downloaded and locationTypes is nil, which would then still try to subscript the nil array, which caused a crash
Author
|
The storyboard obviously has a load of 'unintended' changes. All I did was open it in Xcode 13.4.1 and tick the boxes for the map views to make them show the user location, but Xcode wanted to change/update a load of other things too! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's a suggested improvement to the app that hopefully you'll consider!
The maps are a great feature of the app, but I find it tricky to use them without knowing where I am on the map so I thought I'd have a go at adding that functionality!
Basically I've just requested 'while in use' location permission when the user opens a map screen so they're only asked for permission if they actually want to go to the maps. The user is prompted over the map if they want to give permission once, always when the app is running or decline completely.
If they give permission for the location to be used once their location will show on the map for the current app 'run' and then they'll be prompted again the next time they restart the app if they want to give permission again or always when the app is running, or decline.
Here's how it looks with the default user location annotation being used:

I wondered whether it was worth putting a little banner above or below the map for any users that decline access to the location suggesting they could get their location on the map by providing access, but didn't want to make this PR too big by adding that straight away (chances are they'd know it would be possible anyway!).
(There's also a little fix for a crash I spotted on the 'all locations' screen when no data had downloaded)