     @IBOutlet weak var collectionView: UICollectionView!
     
     var searchResults: [AXCGiphy]?
+    var debounceTimer: NSTimer?
     
     override func viewDidLoad() {
         super.viewDidLoad()


extension GifSearchViewController: UISearchBarDelegate {
    
    func searchBarTextDidBeginEditing(searchBar: UISearchBar) {
        searchBar.setShowsCancelButton(true, animated: true)
    }

    }
    
    func searchBar(searchBar: UISearchBar, textDidChange searchText: String) {
        let userInfo:[String:String] = ["searchText":searchText]
        
        if let timer = debounceTimer {
            timer.invalidate()
        }
        
        debounceTimer = NSTimer(timeInterval: 1.5, target: self, selector: Selector("searchGif:"), userInfo: userInfo, repeats: false)
        NSRunLoop.currentRunLoop().addTimer(debounceTimer!, forMode: "NSDefaultRunLoopMode")
    }
    
}

// MARK: Collection View Delegate
