Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISearchController dimsBackgroundDuringPresentation is deprecated

I see the dimsBackgroundDuringPresentation is now deprecated in iOS SDK 12. What is the replacement of this attribute?

like image 263
Doctiger Avatar asked Apr 01 '21 14:04

Doctiger


People also ask

What is the uisearchcontroller in Interface Builder?

The UISearchController was introduced a couple years ago in iOS 8 to replace the now deprecated UISearchDisplayController. In the new search controller, it is easier to add search to your table views. As of Xcode 8.1, the UISearchController has not been added to Interface Builder, so you have to add it programmatically.

How to show search results in uisearchcontroller?

The initializer to UISearchController can take an argument that can specify a different view controller to show the search results. I think the most common use case is to show the search results in the same view controller that has the table view. Passing nil indicates that we do not want another view controller to show the search results.

What are the limitations of the uisearchcontroller?

One limitation with the UISearchController is it only works with UITableViewControllers. Regular UIViewControllers that contain a UITableView are not supported. In my next blog post, I’ll show you how you can get around this limitation.

What does “passing nil” mean in uisearchcontroller?

Passing nil indicates that we do not want another view controller to show the search results. Now that we created the UISearchController, we need to apply a few settings. In the viewDidLoad function configure the UISearchController with the following code: Let me explain what you just added:


1 Answers

In Docs Use the

obscuresBackgroundDuringPresentation 

property instead.

like image 198
Sh_Khan Avatar answered Nov 15 '22 12:11

Sh_Khan