teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

2つ追記。

2018/08/16 00:42

投稿

fuzzball
fuzzball

スコア16733

answer CHANGED
@@ -1,3 +1,5 @@
1
+ # locationManager(_:didUpdateLocations:)
2
+
1
3
  ```swift
2
4
  func locationManager(_ manager: CLLocationManager, didUpdatelocations locations: [CLLocation])
3
5
  {
@@ -5,4 +7,17 @@
5
7
  }
6
8
  ```
7
9
 
8
- を`searchBarSearchButtonClicked(_:)`の外に出して下さい。
10
+ を`searchBarSearchButtonClicked(_:)`の外に出して下さい。
11
+
12
+ # L
13
+
14
+ `didUpdatelocations`ではなく`didUpdateLocations`です。
15
+
16
+ # Info.plist
17
+
18
+ ```swift
19
+ manager.requestWhenInUseAuthorization()
20
+ ```
21
+
22
+ ならば、Info.plistに書くのは`NSLocationWhenInUseUsageDescription`です。
23
+ > Privacy - Location When In Use Usage Description`