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
Iconwith 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) -> IconParameters
nameThe name of the image asset.
bundleThe bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.
traitCollectionThe traits associated with the intended environment for the image. Specify nil to use the traits associated with the main screen.
-
Returns
Iconwith 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
Iconwith 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
Iconwith 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) -> IconParameters
nameThe name of the system symbol image.
configurationThe configuration to specify traits and other details that define the variant of image.
View on GitHub
Icon Structure Reference