SearchInAppsSDK Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
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.
-
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 }
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-07 UTC."],[[["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."]]],["The `SearchContentViewController` class, available on iOS 14 and later, simplifies the integration of `SearchContentView` in UIKit. To use it, create an instance with customization options, add it to the view controller, and add its view to the parent view. Assign search contents using `searchContents` to display the UI, and access the `blockData` to define how to display it. Customization is also possible via `customizationOptions`. The actual UI element is accessible via the `view` property.\n"]]