Xcode9プログラミングメモ
従来はtableView.tableHeaderViewにsearchControllerを追加していたが、iOS11からは navigationItem に追加が必要。
[php]
if (@available(iOS 11.0, *)) {
	self.navigationItem.searchController = _searchController;
	self.navigationItem.hidesSearchBarWhenScrolling = NO;		// 常にサーチバーを表示
} else {								// iOS10までの従来方式
	self.tableView.tableHeaderView = _searchController.searchBar;
}
[/php]
 
	 
			 
			 
			
コメント