Magpie is an idea board iOS app for sprint retrospective meetings implemented using Firebase. It is the iOS counterpart of Kestrel.
This project is part of 52projects and the new stuff that I learn through this project: Firebase iOS, Eureka, and APESuperHUD.
Magpie is the iOS app version of Kestrel using Firebase iOS. The iOS app talks to the same database as used by Kestrel. It utilises the Firebase Realtime Database that synchronises in realtime to every connected client (using WebSocket). After logging in, a user can view the lists and cards for the sprint retrospective meeting. The screenshots of the iOS app can be seen below:
The app is a standard iPhone app implemented using Swift and it's using CocoaPods as the dependency manager. The app utilises APESuperHUD to display the modal message view. In addition, Magpie uses Eureka to build the form for LogInViewController using custom operators:
override func viewDidLoad() {
super.viewDidLoad()
form +++ Section("Authentication")
<<< EmailRow() { row in
row.title = "Email"
row.tag = "email"
}
<<< PasswordRow() {
$0.title = "Password"
$0.tag = "password"
}
...
}Magpie uses convenient classes as provided by the FirebaseDatabaseUI package to bind the Firebase data to a table view and a collection view. For example, here is the viewDidLoad implementation of BoardViewController:
override func viewDidLoad() {
super.viewDidLoad()
...
let ref = FIRDatabase.database().reference()
let query = ref.child("lists").queryOrderedByKey()
dataSource = tableView.bind(to: query, populateCell: { (tableView: UITableView, indexPath: IndexPath, snapshot: FIRDataSnapshot) -> UITableViewCell in
let cell = tableView.dequeueReusableCell(withIdentifier: "boardTableViewCell", for: indexPath)
guard let value = snapshot.value as? NSDictionary else { return cell }
let title = value["title"] as? String ?? ""
cell.textLabel?.text = title
return cell
})
}The above code binds the table view with the Firebase database query. The table view is updated automatically when the database changes (insertion, deletion, and modification)!
Magpie is a simple iOS app for sprint retrospective meetings. Using the Firebase database in iOS is quite a straight forward process. And it is further simplified by using the Firebase convenient classes that bind the UI elements (table view or collection view) to the database query. This is quite a neat trick! This is the first time I use Eureka. Generally I don't like custom operators since it's very hard to decipher the meaning and we need to look up the documentation. But I guess with custom operators, methods to implement forms using Eureka become quite short and small. It's been a good learning process to use Firebase Web and iOS.


