     
     private func createSearchBar() {
         if self.tableView.tableHeaderView == nil {
-            let theSearchBar = UISearchBar(frame: CGRectMake(0, 0, 320, 40))
-            theSearchBar.showsCancelButton = true
-            tableView.tableHeaderView = theSearchBar
+//            let theSearchBar = UISearchBar(frame: CGRectMake(0, 0, 320, 40))
+//            theSearchBar.showsCancelButton = true
+           
             
-            searchController = UISearchDisplayController(searchBar: theSearchBar, contentsController: self)
-            searchController.delegate = self
-            searchController.searchResultsDataSource = self
-            searchController.searchResultsDelegate = self
-            theSearchBar.becomeFirstResponder()
+            searchController = UISearchController(searchResultsController: nil)
+            searchController.searchResultsUpdater = self
+            searchController.dimsBackgroundDuringPresentation = false
+            tableView.tableHeaderView = searchController.searchBar
         }
     }
     

extension MICountryPicker {
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        if let searchTableView = searchDisplayController {
            if tableView == searchTableView.searchResultsTableView {
                return 1
            } else {
                sections.count
            }
        }
        
        return sections.count
    }
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        if let searchTableView = searchDisplayController {
            if tableView == searchTableView.searchResultsTableView {
                return filteredList.count
            } else {
                sections[section].countries.count
            }
        }
        return sections[section].countries.count
    }

        
        let cell: UITableViewCell! = tempCell
        
        if searchController.searchBar.isFirstResponder() {
            let country = filteredList[indexPath.row]
            cell.textLabel?.text = country.name
        } else {
            let country = sections[indexPath.section].countries[indexPath.row]
            cell.textLabel?.text = country.name
