如何在 iOS 中将 UISearch 栏设置为 UiActionSheet?

How to set UISearch bar to UiActionSheet in iOS?

我只是想知道是否可以在 iOS 应用程序中将 UISearchBarUISearchDisplayController 设置为 UIActionSheet

UIActionSheet 已弃用,其替代品是 UIAlertController。不过,我认为我不会尝试在其上放置 UISearchBar。

我会使用常规的 UIViewController,并将 modalPresentationStyle 设置为 UIModalPresentationPopover,然后将其呈现为 popover using its popoverPresentationController property。此方法至少需要 iOS 8.