Skip to content

Obtaining location information while using the app

   

#Swift 4.2

This is a sample code to get the latitude and longitude while using the app.
The label string is updated when the latitude and longitude of the terminal change.

Reference:
[iOS] 位置情報の取得 (Swift3編)
【CoreLocation】位置情報を取得する

If you use LocationManager, you must include the “purpose for which location information is used” in your Info.plist.

If you want to get location information only during startup

NSCattionWhenInUseUsageDescription
This app gets location information to guide you on the map.

If you always want to get location information

NSCationAlwaysUsageDescription.
This app always gets the location information to get the travel distance.

When the location information is changed, a character will appear on the label.

alt

  1. The interaction of the Lifesum app was nice, so I tried to recreate it.
  2. 押すとクニュっとするボタンを実装する
  3. Docker image that can be SSHed in(Ubuntu14.04)
  4. Obtaining JSON from the API using Alamofire(Swift4.2)
  5. Renaming a project in Xcode10
  6. Creating a Group Style TableView
  7. Getting the SafeArea