LoginSignup
1
1

More than 5 years have passed since last update.

UISearchControllerのobscuresBackgroundDuringPresentationについて

Posted at

結果を自動で表示してくれるobscuresBackgroundDuringPresentation

iOS9.1からUISearchControllerにはobscuresBackgroundDuringPresentationというプロパティがつきました。
これはユーザーが検索バーで文字を入力した時に、すぐにsearchResultsControllerをつかって結果を表示してくれるというもの。
(デフォルト値はYESです。Appleは、検索対象のリストと検索結果を表示するリストを同じViewControllerで表示するなら、NOにセットしておくべきだと言ってます。)

iOS8では、このプロパティがないので検索文字入れても表示されない?

自分の場合、UISearchControllerのカスタムクラスをつかったためか、iOS8では結果が表示されませんでした。
(普通にUISearchControllerを使えば結果が表示されます。)
そのため、わざわざsearchController.active = YESしないといけませんでした。
なぜでしょう。。。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1