Skip to content

Conversation

@ChrisMash
Copy link

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)

return
}

let locations = locationTypes[indexPath.row].locations
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ChrisMash
Copy link
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant