EnlightenPopoverContentViewController
open class EnlightenPopoverContentViewController : NSViewController
A view controller that manages a EnlightenDownView
for the content of a popover.
-
The progress indicator shown when loading the web view resources takes longer than
progressIndicatorDelay
.Declaration
Swift
public let progressIndicator: NSProgressIndicator
-
The popover’s
EnlightenPopoverDelegate
delegate.Declaration
Swift
public weak var enlightenPopoverDelegate: EnlightenPopoverDelegate?
-
The duration, in seconds, to delay showing the progress indicator.
Declaration
Swift
public var progressIndicatorDelay: TimeInterval
-
Whether the content is detached from the popover.
Declaration
Swift
public private(set) var isDetachedFromPopover: Bool { get set }
-
The
EnlightenDownView
owned by the view controller.Declaration
Swift
public var downView: EnlightenDownView { get }
-
Whether the Markdown content should be center aligned.
Declaration
Swift
public var doesCenterAlignContent: Bool { get set }
-
Initializes a newly allocated Enlighten popover content view controller.
Throws
Throws aDownErrors
if loading the Markdown string fails.Declaration
Swift
public init(markdownString: String, maxWidth: CGFloat, maxHeight: CGFloat = 500) throws
Parameters
markdownString
The Markdown string rendered in the
EnlightenDownView
.maxWidth
The maximum width of the
EnlightenDownView
.maxHeight
The maximum height of the
EnlightenDownView
. -
Undocumented
Declaration
Swift
public required init?(coder: NSCoder)
-
Resets the size of the view to the maximum.
Declaration
Swift
open func resetMaxSize(includingHeight: Bool)
Parameters
includingHeight
Whether to also reset the height to the maximum.
-
Shows the progress indicator, if the view controller’s view is in the view hierarchy.
Declaration
Swift
@objc open func showProgressIndicator()
-
Starts the timer that presents the progress indicator after
progressIndicatorDelay
.Declaration
Swift
open func delayShowingProgressIndicator()
-
Hides the progress indicator, if it is in the view hierarchy, and invalidates the progress indicator presentation timer.
Declaration
Swift
open func hideProgressIndicator()
-
Renders the given CommonMark Markdown string into HTML and updates the
EnlightenDownView
while keeping the style intact.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.
-
Called when the Markdown string was loaded successfully.
Declaration
Swift
open func didDownViewLoadSuccessfully()
-
Invoked when the popover has been released to a detached state.
Declaration
Swift
open func didDetachFromPopover()
-
Invoked when the popover did close.
Declaration
Swift
open func didClosePopover()
-
Undocumented
Declaration
Swift
public func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask)
-
Undocumented
Declaration
Swift
public func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask)