         resultsTableController.foundPeople = searchResults
         resultsTableController.tableView.reloadData()
     }
-    
-    
-    // MARK: - UIStateRestoration
-
-    override func encodeRestorableStateWithCoder(coder: NSCoder) {
-        super.encodeRestorableStateWithCoder(coder)
-        coder.encodeObject(title, forKey: OSTContactsViewController.TitleKey)
-        
-        let searchDisplayControllerIsActive: Bool = searchController.active
-        coder.encodeBool(searchDisplayControllerIsActive, forKey: OSTContactsViewController.SearchControllerIsActiveKey)
-        
-        if searchDisplayControllerIsActive {
-            coder.encodeBool(searchController.searchBar.isFirstResponder(), forKey: OSTContactsViewController.SearchBarIsFirstResponderKey)
-        }
-        
-        coder.encodeObject(searchController.searchBar.text, forKey: OSTContactsViewController.SearchBarTextKey)
-    }
-    
-    override func decodeRestorableStateWithCoder(coder: NSCoder) {
-        super.decodeRestorableStateWithCoder(coder)
-        title = coder.decodeObjectForKey(OSTContactsViewController.TitleKey) as? String
-        searchControllerWasActive = coder.decodeBoolForKey(OSTContactsViewController.SearchControllerIsActiveKey)
-        searchControllerSearchFieldWasFirstResponder = coder.decodeBoolForKey(OSTContactsViewController.SearchBarIsFirstResponderKey)
-        searchController.searchBar.text = coder.decodeObjectForKey(OSTContactsViewController.SearchBarTextKey) as? String
-    }
 
 }

            realmNotification = realm.addNotificationBlock({ [weak self](notificationString, realm) -> Void in
                self?.tableView.reloadData()
            })
        }
    }
    
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        
        // searchController state restoration
        if searchControllerWasActive {
            searchController.active = searchControllerWasActive
            searchControllerWasActive = false
            
            if searchControllerSearchFieldWasFirstResponder {
                searchController.searchBar.becomeFirstResponder()
                searchControllerSearchFieldWasFirstResponder = false
            }
        }
    }
    

    
    var resultsTableController: OSTResultsTableController
    var searchController: UISearchController
    
    required init(coder aDecoder: NSCoder) {
        people = OSTPerson.allObjectsInRealm(realm).sortedResultsUsingProperty("fullName", ascending: true)
