Overall great job so far. But please revise your documentation. For example the following code sniped with FirebaseTableViewDataSource in swift:
self.dataSource = FirebaseTableViewDataSource(ref: firebaseRef cellClass: YourCustomClass.self cellReuseIdentifier: @"<YOUR-REUSE-IDENTIFIER>" view: self.tableView)
self.dataSource.populateCellWithBlock { (cell: YourCustomClass, obj: NSObject) -> Void in
// Populate cell as you see fit, like as below
cell.yourCustomLabel.text = snap.key;
}
self.tableView.dataSource = self.dataSource;
There are some mistakes in this code...
Valid swift code could look like this:
self.dataSource = FirebaseTableViewDataSource(ref: firebaseRef, cellClass: YourCustomClass.self, cellReuseIdentifier: "<YOUR-REUSE-IDENTIFIER>", view: self.tableView)
self.dataSource.populateCellWithBlock { (cell: YourCustomClass, obj: NSObject) -> Void in
let snap = obj as! FDataSnapshot
// Populate cell as you see fit, like as below
cell.yourCustomLabel.text = snap.key
}
self.tableView.dataSource = self.dataSource
...But nevertheless, this code doesn't work
Looks like all the swift documentation is incorrect.
Yes it's all out of whack :cry: . I'll be working on this soon, so sit tight.
Cool, thanks for your reply. Looking forward for your alterations!
Hi @davideast do you have a timeline for these updates? The above code simply doesn't work anymore and it would be great to actually use this.
I am currently new to iOS and have been learning swift only. I am unable to find any documentation on how to use the FirebaseUI. I have managed to install it but completely stuck on how to even use this. The manual method of calling methods on the firebase website seems to be more properly documented and user friendly for a swift dev. Can you either provide a sample/steps if possible on how the firebaseUI should help me ! Thanks
Hi .. did anyone manage to get this snippet work? Xcode is giving error on this line. I can't reference it to my custom class on this line self.datasource.populateCellWithBlock{ (cell: GuestTableViewCell, obj: NSObject) -> Void in
self.datasource = FirebaseTableViewDataSource(ref: guestRef, cellClass: GuestTableViewCell.self, cellReuseIdentifier: "GuestTableViewCell", view: self.guestList)
self.datasource.populateCellWithBlock{ (cell: GuestTableViewCell, obj: NSObject) -> Void in
let snapshot = obj as! FIRDataSnapshot
cell.guestName.text = snapshot.key as String
}
self.guestList.dataSource = self.datasource
Thanks!
@Blankarsch I've just merged a PR updating all these readme docs (#98); if you still have trouble with this feel free to reopen this.
Most helpful comment
I am currently new to iOS and have been learning swift only. I am unable to find any documentation on how to use the FirebaseUI. I have managed to install it but completely stuck on how to even use this. The manual method of calling methods on the firebase website seems to be more properly documented and user friendly for a swift dev. Can you either provide a sample/steps if possible on how the firebaseUI should help me ! Thanks