【问题标题】:Swift and Firebase 3.x saving and retrieving dataSwift 和 Firebase 3.x 保存和检索数据
【发布时间】:2016-06-24 02:57:25
【问题描述】:

我正在使用以下代码将数据保存在一个视图中:

let item1:String = textfield.text!

if TextField1.text != "" {
    self.ref.child("userProfile").child((user!.uid)/value1Total").setValue(Double(item1)!)
}

将保存的值设置为标签的不同视图中的代码是什么?

【问题讨论】:

    标签: swift firebase swift2 firebase-realtime-database firebase-authentication


    【解决方案1】:

    你可以试试下面的例子:

    let name = nameTextField.text
    
    let user: NSDictionary = ["name":name!,"dob":dateOfBirthTimeInterval]
    
    //add firebase child node
    let profile = firebase.ref.childByAppendingPath(name!)
    
    // Write data to Firebase
    profile.setValue(user)
    

    看看这个link了解更多信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-05
      • 1970-01-01
      • 2021-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-28
      相关资源
      最近更新 更多