SearchInAppsSDK Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
SearchSuggestionsViewController
@available(iOS, introduced: 14)
@objc
@objcMembers
class SearchSuggestionsViewController
A class to make it easier to use the SearchSuggestionsView in UIKit applications.
The way this is to be included in a UIViewController is to:
- Create an instance of a SearchSuggestionsViewController with a specified customization option
_searchSuggestionsViewController = [[SearchSuggestionsViewController alloc] initWithCustomizationOption: [[SearchSuggestionsViewCustomizationOption alloc] init]];
- Add this to the view controller
[_searchSuggestionsViewController addToViewController:self];
- Add its view to the parent view
[self.view addSubview:_searchSuggestionsViewController.view];
- Assign search suggestions to it to render those search suggestions.
dispatch_async(dispatch_get_main_queue(), ^{
_searchSuggestionsViewController.searchSuggestions = _searchSuggestions;
}
-
The customization options of the search suggestions view.
-
The search suggestions used to generate the UI.
Declaration
Swift
@available(iOS, introduced: 14)
@objc
var searchSuggestions: SearchSuggestions? { get set }
-
The UIView of the search suggestions 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-08-06 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-08-06 UTC."],[[["`SearchSuggestionsViewController` simplifies the integration of `SearchSuggestionsView` within UIKit applications."],["It requires instantiation, addition to a view controller, view embedding, and search suggestions assignment for rendering."],["The class exposes properties for customization options (`customizationOptions`), search suggestions data (`searchSuggestions`), and the underlying view (`view`)."]]],["The `SearchSuggestionsViewController` class, available on iOS 14 and later, simplifies integrating `SearchSuggestionsView` into UIKit. Key actions involve creating an instance with customization options, adding it to a view controller, and then adding its view to the parent view. Search suggestions are assigned via the `searchSuggestions` property, which are used to generate the UI. The `customizationOptions` property controls the display of the view and the `view` property retrieves the `UIView`.\n"]]