EnlightenDownView
open class EnlightenDownView : DownView
A sizeable and self-fitting web view that renders a CommonMark Markdown string.
-
Whether a mouse drag event should move the window.
Declaration
Swift
public internal(set) var mouseDragShouldMoveWindow: Bool
-
The maximum width the view can use.
Declaration
Swift
public var maxWidth: CGFloat { get set }
-
The maximum height the view can use.
If the Markdown content exceeds this height, scrolling is enabled.
Declaration
Swift
public var maxHeight: CGFloat { get set }
-
The minimum height the view can be.
Note
This is dependent on the CSS styling.Declaration
Swift
open var minHeight: CGFloat
-
Whether the Markdown content should be center aligned.
Declaration
Swift
public var doesCenterAlignContent: Bool { get set }
-
Whether document scrolling is enabled.
This property is determined by the
maxHeight
property and the actual height of the rendered Markdown document.Declaration
Swift
public internal(set) var isScrollingEnabled: Bool { get set }
-
Whether the final width of the HTML document has been determined.
Declaration
Swift
@objc dynamic public var isFinalWidth: Bool
-
Undocumented
Declaration
Swift
override open var intrinsicContentSize: NSSize { get }
-
Declaration
Swift
public override init(frame: CGRect, markdownString: String, openLinksInBrowser: Bool, templateBundle: Bundle? = nil, configuration: WKWebViewConfiguration?, didLoadSuccessfully: DownViewClosure?) throws
-
Undocumented
Declaration
Swift
required public init?(coder: NSCoder)
-
Computes and resizes the view to best fit the document’s content size, respecting the minimum and maximum allowed size.
This method updates the values of the
cachedContentSize
andisFinalWidth
properties.Declaration
Swift
open func computeContentSize()
-
Updates the
cachedWidestElementWidth
property.Declaration
Swift
open func cacheWidthOfWidestElement()
-
Sets the document body’s
margin-top
CSS property to a specified px value.Declaration
Swift
open func setBodyTopMargin(to pxValue: CGFloat)
-
Removes any previous values set by
setBodyTopMargin(to:)
.Declaration
Swift
open func resetBodyTopMargin()
-
Sets the document body’s
text-align
CSS property to match the behavior of thedoesCenterAlignContent
property.Declaration
Swift
open func setBodyTextAlignProperty()
-
Sets the CSS overflow property to match the behavior of the
isScrollingEnabled
property.Declaration
Swift
open func setDocumentScrollProperty()
-
Sets the CSS color scheme according to the receiver’s effective appearance.
Declaration
Swift
open func setPreferredColorScheme()
-
Gets the scroll size of the HTML document and passes it in to a closure.
Declaration
Swift
public func htmlScrollSize(completionHandler: @escaping (NSSize) -> Void)
Parameters
completionHandler
A closure to invoke with the resulting size.
-
Gets the width of the widest top-level element in the body of the document and passes it in to a closure.
Declaration
Swift
public func widthOfWidestElement(completionHandler: @escaping (CGFloat) -> Void)
Parameters
completionHandler
A closure to invoke with the resulting width.
-
Undocumented
Declaration
Swift
override open func layout()
-
Undocumented
Declaration
Swift
override open func mouseDown(with event: NSEvent)
-
Undocumented
Declaration
Swift
override open func mouseDragged(with event: NSEvent)