     var pageViewController: UIPageViewController!
     
     var searchText: String = ""
+    var searchDelayTimer: Timer?
+    var searchDelayBlock: (() -> ())?
     
     var searchResults: [SearchType: [Any]] = [
         .episodes: [],

        }
    }
    
    func fetchData(type: SearchType, query: String, offset: Int, max: Int) {
        
        System.endpointRequestQueue.cancelAllEndpointRequestsOfType(type: SearchEpisodesEndpointRequest.self)

    //MARK: UISearchResultsUpdating
    //MARK: -
    
    func updateSearchResults(for searchController: UISearchController) {
        guard let searchText = searchController.searchBar.text, searchText != "" else { return }
    
        if let timer = searchDelayTimer {
            timer.invalidate()
            searchDelayTimer = nil
        }
        
        searchDelayBlock = {
            self.searchText = searchText
            self.sectionOffsets = [.episodes: 0, .series: 0, .people: 0, .tags: 0]
            self.fetchData(type: .all, query: searchText, offset: 0, max: self.pageSize)
            searchController.searchResultsController?.view.isHidden = false
        }
        
        searchDelayTimer = Timer.scheduledTimer(timeInterval: 0.5, target: self, selector: #selector(searchAfterDelay), userInfo: nil, repeats: false)
    }
    
    func updateCurrentViewControllerTableView(append: Bool, indexBounds: (Int, Int)?) {
