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

質問編集履歴

1

情報修正

2019/11/25 18:42

投稿

globalplus
globalplus

スコア119

title CHANGED
File without changes
body CHANGED
@@ -26,17 +26,18 @@
26
26
  print("位置情報を保存しました")
27
27
  }
28
28
  //DBから取得できていない
29
- //コンソール表示otherUserLatitude: nil otherUserLongitude: nil
30
29
  @IBAction func othersLocation(_ sender: Any)
31
30
  {
32
31
  ref.child("userLatitude").observeSingleEvent(of: .value, with: { (snapshot) in
33
32
  let value = snapshot.value as? NSDictionary
34
33
  let otherUserLatitude = value?["userLatitude"] as? Double
34
+ //コンソール表示otherUserLatitude: nil
35
35
  print("otherUserLatitude:", otherUserLatitude)
36
36
  })
37
37
  ref.child("userLongitude").observeSingleEvent(of: .value, with: { (snapshot) in
38
38
  let value = snapshot.value as? NSDictionary
39
39
  let otherUserLongitude = value?["userLongitude"] as? Double
40
+ //コンソール表示otherUserLongitude: nil
40
41
  print("otherUserLongitude:", otherUserLongitude)
41
42
  })
42
43
  }