 import Willow
 import DATAStack
 import CoreData
+import PKHUD
 
 class ContentViewController: UIViewController {
 


    // Do any additional setup after loading the view.
    setupView()
  }

  override func viewDidAppear(_ animated: Bool) {
    log.info("in ContentViewController .viewDidAppear")

    fetchStationData()
  }

  override func didReceiveMemoryWarning() {

    }
    return result
  }
  
  func makeAnnotationsFromStations() -> [MKPointAnnotation] {
    var result = [MKPointAnnotation]()
    
    if let stations = self.viewModel?.hubwayData {
//    if self.items.count > 0 {
      if !stations.isEmpty {
//      for station in self.items {
        if let hubwayData = self.viewModel?.hubwayData {
          for station in hubwayData {
            let stationLat = CLLocationDegrees(station.station.latitude!)
            let stationLong = CLLocationDegrees(station.station.longitude!)
            let location = CLLocationCoordinate2D(latitude: stationLat!, longitude: stationLong!)
            let annotation = MKPointAnnotation()
            annotation.coordinate = location
            annotation.title = station.stationName
            annotation.subtitle = "available bikes: \(station.availableBikes)"
            result.append(annotation)
          }
        }
      }
    }
    return result
  }

}
extension ContentViewController: ISHPullUpContentDelegate {
