Commit 35f17dee authored by Philip Brechler's avatar Philip Brechler

Remove boilerplate from Hatchery

parent 825754c0
......@@ -16,6 +16,14 @@ protocol HatcheryClientDelegate: class {
func didFailToDownloadEgg()
}
// Empty implementations to prevent errors
extension HatcheryClientDelegate {
func didRefreshListOfEggs() {}
func didFailToRefreshListOfEggs(_ error: Error?) {}
func didDownloadEggToPath(_ path: URL) {}
func didFailToDownloadEgg() {}
}
class HatcheryClient: NSObject, URLSessionDelegate {
let hatcheryBaseURL: URL = URL(string:"https://badge.team/")!
......
......@@ -45,10 +45,6 @@ class HatcheryDetailViewController: UIViewController,HatcheryClientDelegate {
//MARK: - HatcheryClientDelegate
func didRefreshListOfEggs() {}
func didFailToRefreshListOfEggs(_ error: Error?) {}
func didDownloadEggToPath(_ path: URL) {
//TODO: Call BluetoothManager to upload? Just tell the user and they do it Control?
}
......
......@@ -138,10 +138,6 @@ class HatcheryRootTableViewController: UITableViewController,HatcheryClientDeleg
}
}
func didDownloadEggToPath(_ path: URL) {}
func didFailToDownloadEgg() {}
func didFailToRefreshListOfEggs(_ error: Error?) {
self.refreshControl?.endRefreshing()
var errorToShow: String = "Failed to download eggs"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment