I just got my app working on firebase, I just have the small problem of it overwriting the data.
The action:
@IBAction func Gem(_ sender: UIButton) {
self.ref.child("users").child(Personnr.text!).setValue(["Fornavn": Fornavn.text!])
self.ref.child("users").child(Personnr.text!).setValue(["Efternavn": Efternavn.text!])
}
The problem is that it writes the first command, then erases it and writes the second one. Im new to programming, so its probably something simply.
I have clarified text fields from which the user will write the data which will then be uploaded to the database.
@IBOutlet weak var Fornavn: UITextField!
@IBOutlet weak var Efternavn: UITextField!
@IBOutlet weak var Personnr: UITextField!
@IBOutlet weak var Korekort: UITextField!
Any clues on how to avoid the overwrite?