Icon
public struct Icon : Equatable
A struct that represents the image used in a row.
-
The image for the normal state.
Declaration
Swift
public let image: UIImage?
-
The image for the highlighted state.
Declaration
Swift
public let highlightedImage: UIImage?
-
Returns
Icon
with an image of the given name for the normal state. The “-highlighted” suffix is appended to the name for the highlighted image.Declaration
Swift
public static func named(_ name: String, in bundle: Bundle? = nil, compatibleWith traitCollection: UITraitCollection? = nil) -> Icon
Parameters
name
The name of the image asset.
bundle
The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.
traitCollection
The traits associated with the intended environment for the image. Specify nil to use the traits associated with the main screen.
-
Returns
Icon
with an image for the normal state. The image for the highlighted state is nil. A method to provide backward compatiblility with the previous enumcase image(UIImage)
.Declaration
Swift
public static func image(_ image: UIImage) -> Icon
-
Returns
Icon
with images for the normal and highlighted states. A method to provide backward compatiblility with the previous enumcase images(normal: UIImage, highlighted: UIImage)
.Declaration
Swift
public static func images(normal: UIImage, highlighted: UIImage) -> Icon
-
Returns
Icon
with the specified SF Symbol as the image for the normal state. The image for the highlighted state is nil.Declaration
Swift
@available(iOS 13.0, tvOS 13.0, *) public static func sfSymbol(_ name: String, withConfiguration configuration: UIImage.Configuration? = nil) -> Icon
Parameters
name
The name of the system symbol image.
configuration
The configuration to specify traits and other details that define the variant of image.