Published on 10/31/2017 7:50 am
#LocationServices in #iOS #Swift #Application

iOS does not provide direct access to the location.We need to ask for the permission if we want to use the location in iOS. Asking for permissions depends on two factors:

  • Asking for user’s location when app is running.
  • Asking for user’s location when is not running.

There will be times when you will require both the location permissions, like, creating an app that shows you the distance from your current position to the nearest shop. For this you will only need the location when the app is in use. But, if you are using an app that needs to update the location each time the user changes it’s location, then you will be needing the access to the location even when the app is not running.
If you need access to your location then you need to change the key in your info.plist file of your app.
The change in the key depends on your requirements,whether you require “always access” or just “when in use”.

The process to change the info.plist file is described below:

1. Create a new project,then select your name of the project in the project navigator window which is topmost file in the project navigator.
2. Then on the right hand window , select the info tab just at the top.

Read more here>> How to Handle Location Services in an iOS Swift Application

0 Comments
Please login to post your comment..