Icon

public struct Icon
extension Icon: Equatable
extension Icon: CustomDebugStringConvertible

An app Icon, as defined in the Info.plist

Public Properties

  • Gets the name of this icon

    Note

    If the name is nil, it is safe to assume this is the default icon.

    Declaration

    Swift

    public let name: String?
  • The user-visible display name for the icon, which is displayed under the icon (and used as the spoken accessibility text) if IconSelector.shouldDisplayLabels is set to true.

    Note

    The default value of this property reflects the Info.plist value with the key CFBundleIconName.

    Declaration

    Swift

    public var localizedName: String?
  • Gets an array of the files associated with this icon

    Declaration

    Swift

    public let files: [String]
  • Gets a flag indicating if this icon has been prerendered or not

    Declaration

    Swift

    public let isPrerendered: Bool
  • Gets a flag indicating whether or not this is the currently selected icon

    Declaration

    Swift

    @available(iOSApplicationExtension, unavailable)
    public var isCurrent: Bool { get }
  • Creates an Icon using the given name and Bundle

    Declaration

    Swift

    public init?(named: String, bundle: Bundle = .main)

    Parameters

    named

    Name of the icon to create

    bundle

    Optional Bundle to find the icon within; defaults to the main bundle.

Parsing the Info.plist

  • Gets the Icons for the main Bundle

    Declaration

    Swift

    public static let main: [Icon]
  • Gets the default Icon, if possible

    Declaration

    Swift

    public static var `default`: Icon?
  • Gets the Icons defined in the given Bundle

    Declaration

    Swift

    public static func options(for bundle: Bundle) -> [Icon]

    Parameters

    bundle

    The Bundle to load from

Accessing images

  • Undocumented

    Declaration

    Swift

    public subscript(name: String) -> UIImage? { get }
  • Undocumented

    Declaration

    Swift

    public subscript(size: CGFloat) -> UIImage? { get }

Making copies

  • Creates a copy of the receiver with the given localizedName.

    Declaration

    Swift

    public func with(localizedName: String) -> Icon

    Parameters

    localizedName

    The user-visible display name to give the icon.

  • Declaration

    Swift

    public static func == (lhs: Icon, rhs: Icon) -> Bool
  • Declaration

    Swift

    public var debugDescription: String { get }