質問編集履歴

1

更新

2018/05/26 07:18

投稿

clo.momo
clo.momo

スコア27

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,73 @@
10
10
 
11
11
 
12
12
 
13
+ これはボクのXcodenoです
13
14
 
15
+ 書いてるファイルが間違ってたりするかもしれないので、画像を載せてみました
16
+
17
+ ![Xcodeの画像](f751db31f82f294fb802aeb2bdbaf2f2.png)
18
+
19
+
20
+
21
+ ファイル名
22
+
23
+ 現在のコード
24
+
25
+ ```Swift
26
+
27
+ import UIKit
28
+
29
+ import CoreLocation
30
+
31
+
32
+
33
+ class LocationService: NSObject, CLLocationManagerDelegate {
34
+
35
+
36
+
37
+ let locationManager = CLLocationManager()
38
+
39
+
40
+
41
+ override init() {
42
+
43
+
44
+
45
+ locationManager.desiredAccuracy = kCLLocationAccuracyKilometer
46
+
47
+ locationManager.requestWhenInUseAuthorization()
48
+
49
+
50
+
51
+ super.init()
52
+
53
+ locationManager.delegate = self
54
+
55
+ locationManager.startUpdatingLocation()
56
+
57
+ }
58
+
59
+
60
+
61
+ func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]){
62
+
63
+
64
+
65
+ if let newLocation = locations.last {
66
+
67
+ print("((newLocation.coordinate.latitude),(newLocation.coordinate.latitude))")
68
+
69
+ }
70
+
71
+ }
72
+
73
+ }
74
+
75
+ ```
76
+
77
+
78
+
79
+ 最初のコード
14
80
 
15
81
  ```Swift
16
82