EnlightenSpotlightController

open class EnlightenSpotlightController : NSViewController

The controller for a spotlight-based onboarding presentation.

  • The shape of the followspot spotlight.

    See more

    Declaration

    Swift

    public enum FollowspotShape : CaseIterable, CustomStringConvertible
  • Undocumented

    See more

    Declaration

    Swift

    @objc
    public enum NavigationDirection : Int, CustomStringConvertible
  • Undocumented

    Declaration

    Swift

    weak public var delegate: EnlightenSpotlightControllerDelegate?
  • Whether the spotlight focuses on the view.

    The spotlight focus animation is the scaling of the spotlight iris on a particular view from a followspot (wider) to a profile spot (tighter).

    This property has a default value of true.

    Note

    The followspotShape must not be .none if this property is false.

    Declaration

    Swift

    public var usesProfileSpot: Bool
  • The shape of the followspot.

    This property has a default value of .circle.

    Declaration

    Swift

    public var followspotShape: EnlightenSpotlightController.FollowspotShape
  • The controller’s background color.

    Declaration

    Swift

    public var backgroundColor: NSColor
  • The animation duration, in seconds, used to initially present the controller.

    Note

    Only used if present(in:animating:) is called with a true animating parameter.

    Declaration

    Swift

    public var presentationAnimationDuration: TimeInterval
  • The duration, in seconds, of the followspot transition animation used when initially presenting the controller.

    Note

    Only used if present(in:animating:) is called with a true animating parameter, usesProfileSpot is false, and followspotShape is not .none.

    Declaration

    Swift

    public var presentationFollowspotTransitionAnimationDuration: TimeInterval
  • The duration, in seconds, of the spotlight focus animation.

    The spotlight focus animation is the scaling of the spotlight iris on a particular view from a followspot (wider) to a profile spot (tighter), or vice versa.

    Declaration

    Swift

    public var profileSpotFocusDuration: TimeInterval
  • The timing function of the spotlight focus animation.

    The spotlight focus animation is the scaling of the spotlight iris on a particular view from a followspot (wider) to a profile spot (tighter), or vice versa.

    By default, uses a ease-in-ease-out pacing.

    Declaration

    Swift

    public var profileSpotFocusTimingFunction: CAMediaTimingFunction
  • The duration, in seconds, of the spotlight transition animation.

    The spotlight transition animation is the transitioning of the followspot from one view to the next.

    Declaration

    Swift

    public var followspotTransitionDuration: TimeInterval
  • The timing function of the spotlight transition animation.

    The spotlight transition animation is the transitioning of the followspot from one view to the next.

    By default, uses a ease-in-ease-out pacing.

    Declaration

    Swift

    public var followspotTransitionTimingFunction: CAMediaTimingFunction
  • Whether the controller is presenting.

    Declaration

    Swift

    @objc
    dynamic public private(set) var isPresenting: Bool
  • The most recent direction the user is navigating in.

    Declaration

    Swift

    public private(set) var navigatingDirection: EnlightenSpotlightController.NavigationDirection
  • Undocumented

    Declaration

    Swift

    public let popover: EnlightenPopover
  • Undocumented

    Declaration

    Swift

    public let skipButton: NSButton
  • The currently focused iris.

    Declaration

    Swift

    public var currentIris: EnlightenIris { get }
  • The previously focused iris.

    Declaration

    Swift

    public var previousIris: EnlightenIris? { get }
  • The currently focused view.

    Declaration

    Swift

    public var focusedView: NSView? { get }
  • The previously focused view.

    Declaration

    Swift

    public var previousFocusedView: NSView? { get }
  • Whether the controller is focused on the first iris with no previous iris (i.e. the controller is in its inital state).

    Declaration

    Swift

    public var isInitialIris: Bool { get }
  • Undocumented

    Declaration

    Swift

    public init()
  • Undocumented

    Declaration

    Swift

    required public init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    override open func viewWillLayout()
  • Presents and begins the onboarding introduction.

    Declaration

    Swift

    open func present(in window: NSWindow? = nil, animating: Bool = false)

    Parameters

    window

    The window to present the controller in. When nil, resolves the window in the following order:

    animating

    Whether to animate the addition of the controller to the view hierarchy.

  • Animates the controller’s dismissal.

    Declaration

    Swift

    open func dismiss()
  • Adds an iris to the controller.

    Declaration

    Swift

    open func addSpotlight(iris: EnlightenIris)

    Parameters

    iris

    The iris to add.

  • A convenience method for creating and adding an iris to the controller.

    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.

    Declaration

    Swift

    @discardableResult
    open func addSpotlight(view: NSView, markdownString: String) -> EnlightenIris

    Parameters

    view

    The view to spotlight.

    markdownString

    The CommonMark Markdown string displayed.

    Return Value

    The newly created spotlight iris.

  • A convenience method for creating and adding an iris to the controller.

    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).

    Throws

    Throws an error if the contents of the file markdownFilename cannot be read.

    Declaration

    Swift

    @discardableResult
    open func addSpotlight(view: NSView,
                           markdownFilename: EnlightenIris.MarkdownFilename,
                           in bundle: Bundle) throws -> EnlightenIris

    Parameters

    view

    The view to spotlight.

    markdownFilename

    The name of the CommonMark Markdown file in the provided bundle that will be displayed.

    bundle

    The bundle that contains the Markdown file named markdownFilename.

    Return Value

    The newly created spotlight iris.

  • Returns the iris for a view, if it exists.

    Declaration

    Swift

    open func iris(for view: NSView) -> EnlightenIris?

    Parameters

    view

    The view to return the iris for.

    Return Value

    The iris for view, or nil if no iris for that view has been added to the controller.

  • Animates the change to the next stage of the controller.

    Unlike showNextSpotlight, this method ensures the controller is presented and not already animating a stage change.

    Declaration

    Swift

    public func navigateForward()
  • Animates the change to the previous stage of the controller.

    Unlike showPreviousSpotlight, this method ensures the controller is presented and not already animating a stage change.

    Declaration

    Swift

    public func navigateBackward()
  • Animates the change to the next stage of the controller.

    Note

    This method should rarely be called. The use of navigateForward is preferred.

    Declaration

    Swift

    public func showNextSpotlight()
  • Animates the change to the previous stage of the controller.

    Note

    This method should rarely be called. The use of navigateForward is preferred.

    Declaration

    Swift

    public func showPreviousSpotlight()
  • Adds the skip button to the view hierarchy.

    Declaration

    Swift

    func showSkipButton()
  • The skip button’s action method.

    Declaration

    Swift

    @objc
    func skipButtonAction()