I have a simple shopping list app backed/synced by a firebase and items added by multiple users. I've created data structs for "GroceryItem" and "Users".
One feature of my app is that you can click the cell and it will put a checkmark next to the item as well as change a bool of "completed" to true.
I'm trying to make a button where it will it will moved all check marked items to a separate list called "history".
Below is one of my many failed attempts at this. I also included the error that XCode is giving me:
'Element' (aka 'AnyObject') is not convertible to 'FDataSnapshot'; did you mean to use 'as!' to force downcast?
@IBAction func itemsBoughtACTION(sender: AnyObject) {
ref.queryOrderedByChild("completed").observeEventType(.Value,
withBlock: { snapshot in
for item in snapshot.children {
var lastItem = GroceryItem(item)
}
})
}
EDIT: I just want to data some data already stored in firebase, move it to another firebase location and delete the original.