From b5e68369616cd507cf965342566bb059a77ddd40 Mon Sep 17 00:00:00 2001 From: e145716 Date: Wed, 9 Dec 2015 10:25:38 +0900 Subject: [PATCH] =?UTF-8?q?=E5=86=99=E7=9C=9F=E3=81=AE=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 写真の位置情報を即値で代入し、printする機能を追加しました。しかしやるべきことと主旨がずれている気がします。 --- LocationSample/LocationSample/ViewController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LocationSample/LocationSample/ViewController.swift b/LocationSample/LocationSample/ViewController.swift index a7cb3da..1b95200 100644 --- a/LocationSample/LocationSample/ViewController.swift +++ b/LocationSample/LocationSample/ViewController.swift @@ -48,12 +48,15 @@ class ViewController: UIViewController, CLLocationManagerDelegate { /* 位置情報取得成功時に実行される関数 */ func locationManager(manager: CLLocationManager, didUpdateToLocation newLocation: CLLocation, fromLocation oldLocation: CLLocation){ + let Photolocationlatiitude = 37.33240905 + let Photolocationlongitude = -122.03051211 + // 取得した緯度がnewLocation.coordinate.longitudeに格納されている let lat = newLocation.coordinate.latitude // 取得した経度がnewLocation.coordinate.longitudeに格納されている let long = newLocation.coordinate.longitude // 取得した緯度・経度をLogに表示 - print("latiitude: \(lat) , longitude: \(long)") + print("Photolocationlatiitude: \(Photolocationlatiitude), Photolocationlongitude: \(Photolocationlongitude),\n latiitude: \(lat) , longitude: \(long)") // GPSの使用を停止する.停止しない限りGPSは実行され,指定間隔で更新され続ける. // lm.stopUpdatingLocation() @@ -62,7 +65,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate { /* 位置情報取得失敗時に実行される関数 */ func locationManager(manager: CLLocationManager, didFailWithError error: NSError) { // この例ではLogにErrorと表示するだけ. - print("Error") + print(error) } } \ No newline at end of file