SearchInAppsSDK Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Theme
@objc(SearchSuggestionsViewOptionsTheme)
enum Theme
The theme options for the search suggestions view.
-
The raw type that can be used to represent all values of the conforming
type.
Every distinct value of the conforming type has a corresponding unique
value of the RawValue
type, but there may be values of the RawValue
type that don’t have a corresponding value of the conforming type.
Declaration
Swift
typealias RawValue = Int
-
The theme is always dark mode.
-
The theme is always light mode.
-
Creates a new instance with the specified raw value.
If there is no value of the type that corresponds with the specified raw
value, this initializer returns nil
. For example:
enum PaperSize: String {
case A4, A5, Letter, Legal
}
print(PaperSize(rawValue: "Legal"))
// Prints "Optional("PaperSize.Legal")"
print(PaperSize(rawValue: "Tabloid"))
// Prints "nil"
Declaration
Swift
init?(rawValue: Int)
-
The theme will switch between light and dark modes based on the current system settings.
-
The corresponding value of the raw type.
A new instance initialized with rawValue
will be equivalent to this
instance. For example:
enum PaperSize: String {
case A4, A5, Letter, Legal
}
let selectedSize = PaperSize.Letter
print(selectedSize.rawValue)
// Prints "Letter"
print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
// Prints "true"
Declaration
Swift
var rawValue: Int { 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."],[[["\u003cp\u003e\u003ccode\u003eSearchSuggestionsViewOptions.Theme\u003c/code\u003e defines the theme options for the search suggestions view.\u003c/p\u003e\n"],["\u003cp\u003eIt offers three theme options: \u003ccode\u003ealwaysDark\u003c/code\u003e, \u003ccode\u003ealwaysLight\u003c/code\u003e, and \u003ccode\u003ematchSystem\u003c/code\u003e, allowing control over light and dark mode.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ematchSystem\u003c/code\u003e option dynamically adjusts the theme based on the user's system settings.\u003c/p\u003e\n"],["\u003cp\u003eThe theme can be initialized using a raw integer value corresponding to the desired theme option.\u003c/p\u003e\n"]]],["The `Theme` enum for search suggestions view options defines display modes. It can be set to `alwaysDark`, forcing a dark mode appearance, `alwaysLight`, for a light mode appearance, or `matchSystem`, to dynamically adjust to the system's light/dark mode. Each theme has a corresponding integer `rawValue`. A `rawValue` can be used to create a `Theme` instance using the initializer `init?(rawValue: Int)`. If no `Theme` matches, it returns nil.\n"],null,["# SearchInAppsSDK Framework Reference\n\nTheme\n=====\n\n @objc(SearchSuggestionsViewOptionsTheme)\n enum Theme\n\nThe theme options for the search suggestions view.\n- `\n ``\n ``\n `\n\n ### [RawValue](#/s:15SearchInAppsSDK0A22SuggestionsViewOptionsC5ThemeO8RawValuea)\n\n `\n ` \n The raw type that can be used to represent all values of the conforming\n type.\n\n Every distinct value of the conforming type has a corresponding unique\n value of the `RawValue` type, but there may be values of the `RawValue`\n type that don't have a corresponding value of the conforming type. \n\n #### Declaration\n\n Swift \n\n typealias RawValue = Int\n\n- `\n ``\n ``\n `\n\n ### [alwaysDark](#/s:15SearchInAppsSDK0A22SuggestionsViewOptionsC5ThemeO10alwaysDarkyA2EmF)\n\n `\n ` \n The theme is always dark mode. \n\n #### Declaration\n\n Swift \n\n case alwaysDark\n\n- `\n ``\n ``\n `\n\n ### [alwaysLight](#/s:15SearchInAppsSDK0A22SuggestionsViewOptionsC5ThemeO11alwaysLightyA2EmF)\n\n `\n ` \n The theme is always light mode. \n\n #### Declaration\n\n Swift \n\n case alwaysLight\n\n- `\n ``\n ``\n `\n\n ### [init(rawValue:)](#/s:15SearchInAppsSDK0A22SuggestionsViewOptionsC5ThemeO8rawValueAESgSi_tcfc)\n\n `\n ` \n Creates a new instance with the specified raw value.\n\n If there is no value of the type that corresponds with the specified raw\n value, this initializer returns `nil`. For example: \n\n enum PaperSize: String {\n case A4, A5, Letter, Legal\n }\n\n print(PaperSize(rawValue: \"Legal\"))\n // Prints \"Optional(\"PaperSize.Legal\")\"\n\n print(PaperSize(rawValue: \"Tabloid\"))\n // Prints \"nil\"\n\n #### Declaration\n\n Swift \n\n init?(rawValue: Int)\n\n- `\n ``\n ``\n `\n\n ### [matchSystem](#/s:15SearchInAppsSDK0A22SuggestionsViewOptionsC5ThemeO11matchSystemyA2EmF)\n\n `\n ` \n The theme will switch between light and dark modes based on the current system settings. \n\n #### Declaration\n\n Swift \n\n case matchSystem\n\n- `\n ``\n ``\n `\n\n ### [rawValue](#/s:15SearchInAppsSDK0A22SuggestionsViewOptionsC5ThemeO8rawValueSivp)\n\n `\n ` \n The corresponding value of the raw type.\n\n A new instance initialized with `rawValue` will be equivalent to this\n instance. For example: \n\n enum PaperSize: String {\n case A4, A5, Letter, Legal\n }\n\n let selectedSize = PaperSize.Letter\n print(selectedSize.rawValue)\n // Prints \"Letter\"\n\n print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)\n // Prints \"true\"\n\n #### Declaration\n\n Swift \n\n var rawValue: Int { get }"]]