SearchInAppsSDK Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Classes
The following classes are available globally.
-
Runtime for issuing contextual search requests.
The runtime can be reused across the app after it is initialized.
Declaration
Swift
@objc
final class ContextualSearchRuntime
-
This class contains all the options necessary to request search content.
Declaration
Swift
@objc
final class GetSearchContentOptions
-
This class contains all the options necessary to request search suggestions.
Declaration
Swift
@objc
final class GetSearchSuggestionsOptions
-
This class contains all the options necessary to request trending searches.
Declaration
Swift
@objc
final class GetTrendingSearchesOptions
-
Context used for location-based search suggestions.
Declaration
Swift
@objc
final class LocationSuggestionsContext
-
The data necessary to render a single SearchContentBlock.
Declaration
Swift
@objc
final class SearchContentBlockData
-
Properties to pass to the partner’s delegate when a search content is clicked.
Declaration
Swift
@objc
class SearchContentClickProperties
-
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;
}
Declaration
Swift
@available(iOS, introduced: 14)
@objc
@objcMembers
class SearchContentViewController
-
A collection of search content block data
Declaration
Swift
@available(iOS, introduced: 14)
@objc
final class SearchContents
-
A collection of search suggestions.
This class is opaque externally, but is required for rendering search suggestions by the SDK.
Declaration
Swift
@objc
final class SearchSuggestions
-
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;
}
Declaration
Swift
@available(iOS, introduced: 14)
@objc
@objcMembers
class SearchSuggestionsViewController
-
This class provides all the options to customize the search suggestions UI view.
Declaration
Swift
@objc
class SearchSuggestionsViewOptions
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."],[[["\u003cp\u003eThe SearchInApps SDK provides classes for contextual search requests, fetching search content, suggestions, and trending searches.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize classes to render and customize the UI for both search content and suggestions within their iOS applications.\u003c/p\u003e\n"],["\u003cp\u003eKey classes include \u003ccode\u003eContextualSearchRuntime\u003c/code\u003e, \u003ccode\u003eSearchContentViewController\u003c/code\u003e, \u003ccode\u003eSearchSuggestionsViewController\u003c/code\u003e, and options classes for customization.\u003c/p\u003e\n"],["\u003cp\u003eThese classes facilitate the integration of Google Search features into iOS apps, enhancing user search experience.\u003c/p\u003e\n"]]],["The content details Swift classes for managing search functionalities in iOS apps. `ContextualSearchRuntime` initiates search requests, while `GetSearchContentOptions`, `GetSearchSuggestionsOptions`, and `GetTrendingSearchesOptions` configure specific search parameters. `LocationSuggestionsContext` handles location-based suggestions. `SearchContentBlockData` renders individual blocks of content, and `SearchContentClickProperties` defines actions for clicked content. `SearchContentViewController` and `SearchSuggestionsViewController` are for displaying search content and suggestions in UIKit, respectively. `SearchContents`, `SearchSuggestions` store the data, `SearchSuggestionsViewOptions` handles search suggestions UI.\n"],null,["# SearchInAppsSDK Framework Reference\n\nClasses\n=======\n\nThe following classes are available globally.\n- `\n ``\n ``\n `\n\n ### [ContextualSearchRuntime](/search-in-apps/ios/reference/api/swift_reference/Classes/ContextualSearchRuntime)\n\n `\n ` \n Runtime for issuing contextual search requests.\n\n The runtime can be reused across the app after it is initialized. \n\n #### Declaration\n\n Swift \n\n @objc\n final class ContextualSearchRuntime\n\n- `\n ``\n ``\n `\n\n ### [GetSearchContentOptions](/search-in-apps/ios/reference/api/swift_reference/Classes/GetSearchContentOptions)\n\n `\n ` \n This class contains all the options necessary to request search content. \n\n #### Declaration\n\n Swift \n\n @objc\n final class GetSearchContentOptions\n\n- `\n ``\n ``\n `\n\n ### [GetSearchSuggestionsOptions](/search-in-apps/ios/reference/api/swift_reference/Classes/GetSearchSuggestionsOptions)\n\n `\n ` \n This class contains all the options necessary to request search suggestions. \n\n #### Declaration\n\n Swift \n\n @objc\n final class GetSearchSuggestionsOptions\n\n- `\n ``\n ``\n `\n\n ### [GetTrendingSearchesOptions](/search-in-apps/ios/reference/api/swift_reference/Classes/GetTrendingSearchesOptions)\n\n `\n ` \n This class contains all the options necessary to request trending searches. \n\n #### Declaration\n\n Swift \n\n @objc\n final class GetTrendingSearchesOptions\n\n- `\n ``\n ``\n `\n\n ### [LocationSuggestionsContext](/search-in-apps/ios/reference/api/swift_reference/Classes/LocationSuggestionsContext)\n\n `\n ` \n Context used for location-based search suggestions. \n\n #### Declaration\n\n Swift \n\n @objc\n final class LocationSuggestionsContext\n\n- `\n ``\n ``\n `\n\n ### [SearchContentBlockData](/search-in-apps/ios/reference/api/swift_reference/Classes/SearchContentBlockData)\n\n `\n ` \n The data necessary to render a single SearchContentBlock. \n\n #### Declaration\n\n Swift \n\n @objc\n final class SearchContentBlockData\n\n- `\n ``\n ``\n `\n\n ### [SearchContentClickProperties](#/c:@M@SearchInAppsSDK@objc(cs)SearchContentClickProperties)\n\n `\n ` \n Properties to pass to the partner's delegate when a search content is clicked. \n\n #### Declaration\n\n Swift \n\n @objc\n class SearchContentClickProperties\n\n- `\n ``\n ``\n `\n\n ### [SearchContentViewController](/search-in-apps/ios/reference/api/swift_reference/Classes/SearchContentViewController)\n\n `\n ` \n A class to make it easier to use the SearchContentView in UIKit applications.\n\n The way this is to be included in a UIViewController is to:\n 1. Create an instance of a SearchContentViewController with a specified customization option `_searchContentViewController = [[SearchContentViewController alloc] initWithCustomizationOption: [[SearchContentViewCustomizationOption alloc] init]];`\n 2. Add this to the view controller `[_searchContentViewController addToViewController:self];`\n 3. Add its view to the parent view `[self.view addSubview:_searchContentViewController.view];`\n 4. Assign search contents to it to render search content. `dispatch_async(dispatch_get_main_queue(), ^{\n _searchContentViewController.searchContents = _searchContents;\n }` \n\n #### Declaration\n\n Swift \n\n @available(iOS, introduced: 14)\n @objc\n @objcMembers\n class SearchContentViewController\n\n- `\n ``\n ``\n `\n\n ### [SearchContents](/search-in-apps/ios/reference/api/swift_reference/Classes/SearchContents)\n\n `\n ` \n A collection of search content block data \n\n #### Declaration\n\n Swift \n\n @available(iOS, introduced: 14)\n @objc\n final class SearchContents\n\n- `\n ``\n ``\n `\n\n ### [SearchSuggestions](#/c:@M@SearchInAppsSDK@objc(cs)SearchSuggestions)\n\n `\n ` \n A collection of search suggestions.\n\n This class is opaque externally, but is required for rendering search suggestions by the SDK. \n\n #### Declaration\n\n Swift \n\n @objc\n final class SearchSuggestions\n\n- `\n ``\n ``\n `\n\n ### [SearchSuggestionsViewController](/search-in-apps/ios/reference/api/swift_reference/Classes/SearchSuggestionsViewController)\n\n `\n ` \n A class to make it easier to use the SearchSuggestionsView in UIKit applications.\n\n The way this is to be included in a UIViewController is to:\n 1. Create an instance of a SearchSuggestionsViewController with a specified customization option `_searchSuggestionsViewController = [[SearchSuggestionsViewController alloc] initWithCustomizationOption: [[SearchSuggestionsViewCustomizationOption alloc] init]];`\n 2. Add this to the view controller `[_searchSuggestionsViewController addToViewController:self];`\n 3. Add its view to the parent view `[self.view addSubview:_searchSuggestionsViewController.view];`\n 4. Assign search suggestions to it to render those search suggestions. `dispatch_async(dispatch_get_main_queue(), ^{\n _searchSuggestionsViewController.searchSuggestions = _searchSuggestions;\n }` \n\n #### Declaration\n\n Swift \n\n @available(iOS, introduced: 14)\n @objc\n @objcMembers\n class SearchSuggestionsViewController\n\n- `\n ``\n ``\n `\n\n ### [SearchSuggestionsViewOptions](/search-in-apps/ios/reference/api/swift_reference/Classes/SearchSuggestionsViewOptions)\n\n `\n ` \n This class provides all the options to customize the search suggestions UI view. \n\n #### Declaration\n\n Swift \n\n @objc\n class SearchSuggestionsViewOptions"]]