 
     func searchBar(searchBar: UISearchBar, textDidChange searchText: String) {
 
-        searchControllerIsActive = !searchText.isEmpty
+        //searchControllerIsActive = !searchText.isEmpty
 
         updateSearchResultsWithText(searchText)
     }

            return nil
        }

        if searchControllerIsActive {

            guard let section = Section(rawValue: section) else {
                return nil
            }

            let header = tableView.dequeueReusableHeaderFooterViewWithIdentifier(headerIdentifier) as? TableSectionTitleView

            switch section {
            case .Local:
                header?.titleLabel.text = NSLocalizedString("Friends", comment: "")
            case .Online:
                header?.titleLabel.text = NSLocalizedString("Users", comment: "")
            }

            return header

        } else {
            return nil
        }
    }

    func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {


        switch section {
        case .Local:
            //return searchControllerIsActive ? (filteredFriends?.count ?? 0) : friends.count
            return filteredFriends?.count ?? 0
        case .Online:
            //return searchControllerIsActive ? searchedUsers.count : 0
            return searchedUsers.count
        }
    }

