             }
 
             return view
-        case is AerialVideo:
-            let video = item as! AerialVideo
+        case let video as AerialVideo:
             let view = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "CheckCell"),
                                         owner: nil) as! CheckCellView   // if owner = self, awakeFromNib will be called for each created cell !
             // Mark the new view for this video for subsequent callbacks

    }

    func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
        if item == nil {
            return cities[index]
        }

        switch item {
        case is City:
            let city = item as! City

            if index == 0 && !city.day.videos.isEmpty {
                return city.day


    func outlineView(_ outlineView: NSOutlineView, shouldSelectItem item: Any) -> Bool {
        switch item {
        case let video as AerialVideo:
            player = AVPlayer()
            playerView.player = player

            debugLog("Playing this preview \(video)")
            // Workaround for cached videos generating online traffic
            if video.isAvailableOffline {
