 	case Users = "Users"
 }
 
-class UsersViewController: UITableViewController, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate {
+class UsersViewController: UITableViewController, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate, UIViewControllerPreviewingDelegate {
 
 	var user: User = User.currentUser
 	var displayType: DisplayType = .Users

			API.sharedAPI.searchUsers("", completion: completion)
			title = "Search Users"
			addHamburgerMenu()
		}
    }
	

		statusBarView.removeFromSuperview()
	}

	// MARK: - UIViewControllerPreviewingDelegate
	
	@available(iOS 9.0, *)
	func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
		let tableViewPoint = view.convertPoint(location, toView: tableView)
		
		guard let indexPath = tableView.indexPathForRowAtPoint(tableViewPoint),
			cell = tableView.cellForRowAtIndexPath(indexPath) as? FollowTableViewCell else {
				return nil
		}
		
		let peekViewController = ProfileViewController(nibName: "ProfileViewController", bundle: nil)
		peekViewController.title = "Profile"
		peekViewController.user = searchController.active ? filteredUsers[indexPath.row] : users[indexPath.row]
		
		peekViewController.preferredContentSize = CGSize(width: 0.0, height: 0.0)
		previewingContext.sourceRect = tableView.convertRect(cell.frame, toView: view)
		
		return peekViewController
	}
	
	func previewingContext(previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) {
		let backButton = UIBarButtonItem()
		backButton.title = "Search"
		navigationItem.backBarButtonItem = backButton
		showViewController(viewControllerToCommit, sender: self)
	}
	
}