 // MARK: - UISearchBarDelegate
 extension SearchViewController: UISearchBarDelegate {
     func searchBarSearchButtonClicked(searchBar: UISearchBar) {
+        hasSearched = true
         searchResults = [SearchResult]()
         for i in 0...2 {
             let searchResult = SearchResult()

    
    // MARK: - outlet
    var searchResults = [SearchResult]()
    
    // MARK: - lifeCycle
    override func viewDidLoad() {

extension SearchViewController: UITableViewDataSource {
    func tableView(tableView: UITableView,
            numberOfRowsInSection section: Int) -> Int {
        if !hasSearched {
            return 0
        } else if searchResults.count == 0 {
            return 1
        } else {
            return searchResults.count
