I am in the midst of coding an IOS application using Xcode 8.2.1 in Swift. Currently, I have the database set up for one view controller that implements GeoFire and successfully adds locations to the database. On a separate view controller, I want to add a reference to the same database and add children to this reference.
This separate reference I want to store different arrays that can be accessed by the array name. I want to be able to add and remove the saved arrays in the database. In addition, I want to be able to add and remove the strings that are held in each individual array.
The code that I have tried is:
let ref = FIRDatabase.database().reference()
let childRef = FIRDatabase.database().reference(withPath: "arrays")
let itemsRef = ref.child("arrays")
let milkRef = itemsRef.child("array1")
But when I run this code, the database does not update to show any new children. Is it possible to accomplish my task? If so, what am I doing wrong?
If my question is unclear in any way please let me know and I will be willing to elaborate. Thank you in advance for any help!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…