EnlightenKeyedIris
open class EnlightenKeyedIris<Key> : EnlightenIris where Key : EnlightenSpotlightControllerKeys
A class that encapsulates the behavior of the spotlight for a particular view.
Unlike its key-less variant EnlightenIris, the keyed EnlightenKeyedIris allows the presentation order of all
the irises to be specified by the order of an EnlightenSpotlightControllerKeys enumeration.
-
The key that specifies the presentation order of the iris.
The keyed spotlight controller presents the irises in the order their keys have in the
EnlightenKeyedSpotlightController.presentationOrderKeysinstance property.Declaration
Swift
public let presentationOrderKey: Key
-
Initializes a new keyed iris from the provided stages.
Important
Errors thrown during the loading of the Markdown strings are passed to the spotlight controller’s delegate’s
EnlightenSpotlightControllerDelegate.spotlightControllerFailedToLoad(markdownString:for:with:)method.Note
If using this initializer directly, the iris must still be added to the controller.
Declaration
Swift
public init(presentationOrderKey key: Key, view: NSView, stages: [EnlightenIrisStage], popoverMaxWidth: CGFloat? = nil)Parameters
viewThe view to spotlight for the stages of this iris.
stagesThe stages of this iris.
popoverMaxWidthThe popover’s maximum width. A non-nil value overrides the default
EnlightenIris.popoverMaxWidth. -
Initializes a new keyed iris from the provided stage.
Important
Errors thrown during the loading of the Markdown strings are passed to the spotlight controller’s delegate’s
EnlightenSpotlightControllerDelegate.spotlightControllerFailedToLoad(markdownString:for:with:)method.Note
If using this initializer directly, the iris must still be added to the controller.
Declaration
Swift
public convenience init(presentationOrderKey key: Key, view: NSView, stage: EnlightenIrisStage, popoverMaxWidth: CGFloat? = nil)Parameters
viewThe view to spotlight for the stages of this iris.
stageThe stage of this iris.
popoverMaxWidthThe popover’s maximum width. A non-nil value overrides the default
EnlightenIris.popoverMaxWidth. -
Initializes a new keyed iris from CommonMark Markdown strings.
Important
Errors thrown during the loading of the Markdown strings are passed to the spotlight controller’s delegate’s
EnlightenSpotlightControllerDelegate.spotlightControllerFailedToLoad(markdownString:for:with:)method.Note
If using this initializer directly, the iris must still be added to the controller.
Declaration
Swift
public convenience init(presentationOrderKey key: Key, view: NSView, markdownStrings: [String], popoverMaxWidth: CGFloat? = nil)Parameters
keyThe value (enumeration case) of an enumeration that conforms to the
EnlightenSpotlightControllerKeysprotocol to set as the presentation order key of the iris.viewThe view to spotlight for the stages of this iris.
markdownStringsThe CommonMark Markdown strings displayed as individual stages.
popoverMaxWidthThe popover’s maximum width. A non-nil value overrides the default
EnlightenIris.popoverMaxWidth. -
Initializes a new keyed iris from a CommonMark Markdown string.
Important
Errors thrown during the loading of the Markdown string are passed to the spotlight controller’s delegate’s
EnlightenSpotlightControllerDelegate.spotlightControllerFailedToLoad(markdownString:for:with:)method.Note
If using this initializer directly, the iris must still be added to the controller.
Declaration
Swift
public convenience init(presentationOrderKey key: Key, view: NSView, markdownString: String, popoverMaxWidth: CGFloat? = nil)Parameters
keyThe value (enumeration case) of an enumeration that conforms to the
EnlightenSpotlightControllerKeysprotocol to set as the presentation order key of the iris.viewThe view to spotlight for the stages of this iris.
markdownStringThe CommonMark Markdown string displayed.
popoverMaxWidthThe popover’s maximum width. A non-nil value overrides the default
EnlightenIris.popoverMaxWidth. -
Initializes a new keyed iris from CommonMark Markdown files.
Important
Errors thrown during the loading of the Markdown strings are passed to the spotlight controller’s delegate’s
EnlightenSpotlightControllerDelegate.spotlightControllerFailedToLoad(markdownString:for:with:)method.Warning
Asserts the existence of the Markdown files in ‘Debug’ builds, while failing silently in ‘Release’ builds (by returning an empty string).
Note
If using this initializer directly, the iris must still be added to the controller.
Throws
Throws an error if the contents of a file in
markdownFilenamescannot be read.Declaration
Swift
public convenience init(presentationOrderKey key: Key, view: NSView, markdownFilenames: [MarkdownFilename], in bundle: Bundle, popoverMaxWidth: CGFloat? = nil) throwsParameters
keyThe value (enumeration case) of an enumeration that conforms to the
EnlightenSpotlightControllerKeysprotocol to set as the presentation order key of the iris.viewThe view to spotlight for the stages of this iris.
markdownFilenamesThe names of the CommonMark Markdown files in the provided bundle that will be displayed as individual stages.
bundleThe bundle that contains the Markdown files in
markdownFilenames.popoverMaxWidthThe popover’s maximum width. A non-nil value overrides the default
EnlightenIris.popoverMaxWidth. -
Initializes a new keyed iris from a CommonMark Markdown file.
Important
Errors thrown during the loading of the Markdown string are passed to the spotlight controller’s delegate’s
EnlightenSpotlightControllerDelegate.spotlightControllerFailedToLoad(markdownString:for:with:)method.Warning
Asserts the existence of the Markdown file in ‘Debug’ builds, while failing silently in ‘Release’ builds (by returning an empty string).
Note
If using this initializer directly, the iris must still be added to the controller.
Throws
Throws an error if the contents of the file
markdownFilenamecannot be read.Declaration
Swift
public convenience init(presentationOrderKey key: Key, view: NSView, markdownFilename: MarkdownFilename, in bundle: Bundle, popoverMaxWidth: CGFloat? = nil) throwsParameters
keyThe value (enumeration case) of an enumeration that conforms to the
EnlightenSpotlightControllerKeysprotocol to set as the presentation order key of the iris.viewThe view to spotlight for the stages of this iris.
markdownFilenameThe name of the CommonMark Markdown file in the provided bundle that will be displayed.
bundleThe bundle that contains the Markdown file named
markdownFilename.popoverMaxWidthThe popover’s maximum width. A non-nil value overrides the default
EnlightenIris.popoverMaxWidth.
EnlightenKeyedIris Class Reference