In Firebase 2.5.1, this was working:
let post1Ref = sendRequestRef.childByAutoId()
post1Ref.setValue(request, withCompletionBlock: {( error:NSError?, ref:Firebase!) in
})
However, I couldn't figure out how to achieve it in 3.x (as the docs for completion doesn't really tell it)
let post1Ref = sendRequestRef.childByAutoId()
post1Ref.setValue(request, withCompletionBlock: {( error:NSError?, ref:Firebase!) in
if (error != nil) {
print("ERROR")
} else {
print("Success")
}
})
This throws an error:
Use of unresolved Firebase
What is the proper way of handling completion block with Firebase 3.x?