         NSLog(error)
     }
     
+    private func setLoading(_ loading: Bool) {
+        self.navigationItem.rightBarButtonItem = loading ? self.loadingItem : self.addButton
+    }
+    
 }

                }
            case .failure(let error): return self.handleRequestFailure(error)
            }
        }
    }
    

        return UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(RoutePickerViewController.addButtonTouchUpInside(_:)))
    }()
    
    private lazy var loadingItem: UIBarButtonItem = {
        let indicatorView = UIActivityIndicatorView(activityIndicatorStyle: .gray)
        indicatorView.startAnimating()
        return UIBarButtonItem(customView: indicatorView)
    }()
    
    // MARK: IBOutlets

    @IBOutlet weak var tableView: UITableView!
