I'm having trouble using the Objective-C Firebase framework in a new Swift project. I'm coming from mostly a C# background so the Swift closure syntax isn't that clear yet.
Here's how the code work in Objective-C with f being the Firebase object
[f observeEventType:FEventTypeValue withBlock:^(FDataSnapshot *snapshot) {
NSLog(@"%@ -> %@", snapshot.name, snapshot.value);
}];
XCode auto suggests this syntax, and I have yet to find a working solution.
f.observeEventType(FEventTypeValue, withBlock: ((FDataSnapshot!) -> Void)?)
I'd like assign the FDataSnapshot data to a variable as the Objective-C example is doing. Thanks