EnlightenHelpButton
open class EnlightenHelpButton : NSButton
A help button that displays a popover with app-specific help documentation rendered from a CommonMark Markdown string.
-
The
EnlightenPopover
owned by this help button.Declaration
Swift
public var enlightenPopover: EnlightenPopover!
-
The maximum width of the popover.
Declaration
Swift
@IBInspectable public var popoverWidth: CGFloat { get set }
-
The maximum height of the popover.
Scrolling is enabled if the EnlightenDownView exceeds the maximum height.
Declaration
Swift
@IBInspectable public var popoverMaxHeight: CGFloat { get set }
-
The popover’s
EnlightenPopoverDelegate
delegate.Declaration
Swift
public var enlightenPopoverDelegate: EnlightenPopoverDelegate? { get set }
-
Whether the popover is detachable.
Declaration
Swift
public var canDetachPopover: Bool { get set }
-
Whether the Markdown content should be center aligned.
Declaration
Swift
public var doesCenterAlignContent: Bool { get set }
-
Initializes a newly allocated Enlighten help button.
Throws
Throws aDownErrors
if loading the Markdown string fails.Declaration
Swift
public init(markdownString: String, maxWidth: CGFloat? = nil, maxHeight: CGFloat? = nil) throws
Parameters
markdownString
The Markdown string rendered in the popover.
maxWidth
The maximum width of the popover.
maxHeight
The maximum height of the popover.
-
Undocumented
Declaration
Swift
required public init?(coder: NSCoder)
-
Undocumented
Declaration
Swift
open func commonInit(markdownString: String) throws
-
Updates the popover content from a Markdown file.
Important
Errors thrown during the loading of the Markdown string are passed to the delegate’s
EnlightenPopoverDelegate.enlightenPopoverFailedToLoad(downError:)
method.Declaration
Swift
open func update(markdownString: String)
Parameters
markdownString
A string containing CommonMark Markdown.
-
Updates the popover content from a Markdown file.
Important
Asserts the existence of the Markdown file in ‘Debug’ builds only. Fails silently in ‘Release’ builds.
Throws
Only throws an error if the Markdown file could not be read. Errors thrown during the loading of the Markdown string are passed to the delegate’s
EnlightenPopoverDelegate.enlightenPopoverFailedToLoad(downError:)
method (i.e. not thrown here).Declaration
Swift
open func update(markdownFilename: String, in bundle: Bundle) throws
Parameters
markdownFilename
The name of the Markdown file in the provided bundle to use for the popover content.
bundle
The bundle that contains the Markdown file named
markdownName
.
-
The help button’s action method.
Declaration
Swift
@objc open func helpButtonAction()