AI-generated Key Takeaways
-
SearchContentViewController simplifies the integration of SearchContentView into UIKit applications.
-
Developers can add SearchContentViewController to their UIViewController by creating an instance, adding it, adding its view, and assigning search content.
-
The
blockData
property holds the search content used to generate the UI. -
customizationOptions
provides access to customize the appearance of the search content view. -
view
property exposes the UIView representation of the SearchContentViewController's content for integration into the parent view hierarchy.
SearchContentViewController
@available(iOS, introduced: 14)
@objc
@objcMembers
class SearchContentViewController
A class to make it easier to use the SearchContentView in UIKit applications.
The way this is to be included in a UIViewController is to:
- Create an instance of a SearchContentViewController with a specified customization option
_searchContentViewController = [[SearchContentViewController alloc] initWithCustomizationOption: [[SearchContentViewCustomizationOption alloc] init]];
- Add this to the view controller
[_searchContentViewController addToViewController:self];
- Add its view to the parent view
[self.view addSubview:_searchContentViewController.view];
- Assign search contents to it to render search content.
dispatch_async(dispatch_get_main_queue(), ^{ _searchContentViewController.searchContents = _searchContents; }
-
The search content block data used to generate the UI.
Declaration
Swift
@available(iOS, introduced: 14) @objc var blockData: SearchContentBlockData? { get set }
-
The customization options of the search content view.
Declaration
Swift
@available(iOS, introduced: 14) @objc var customizationOptions: SearchContentViewOptions { get set }
-
The UIView of the search content which is converted from the hostingController’s SwiftUI rootview.
Declaration
Swift
@available(iOS, introduced: 14) @objc var view: UIView { get }