Contents

init(named:inBundle:compatibleWithTraitCollection:)

Creates a color object using the named asset that’s compatible with the specified trait collection.

Declaration

init?(named name: String, inBundle bundle: Bundle?, compatibleWithTraitCollection traitCollection: UITraitCollection?)

Parameters

  • name:

    The name of the asset containing the color.

  • bundle:

    The bundle containing the asset.

  • traitCollection:

    The trait collection that specifies the gamut to use when selecting the color.

Return Value

An initialized color object. The returned object uses the color space specified for the asset.