Skip to content

ShadowView

fumoboy007 edited this page Nov 27, 2020 · 1 revision

ShadowView

A container view that draws a rectangular shadow underneath its content view in a performant manner.

public class ShadowView: NSView

Inheritance

NSView

Initializers

init(frame:)

public override init(frame frameRect: NSRect)

init?(coder:)

public required init?(coder: NSCoder)

Properties

shadow

var shadow: NSShadow?

shadowBlurRadius

The blur radius (in points) used to render the shadow.

var shadowBlurRadius: CGFloat

The default value is 3.

shadowOffset

The offset (in points) of the shadow relative to the content view.

var shadowOffset

The default value is (0, -3).

shadowColor

The color of the shadow.

var shadowColor: NSColor

The default value is opaque black.

contentView

The view on top of the shadow.

var contentView: NSView?

The content view must be rectangular and fully opaque in order for the shadow effect to look convincing.

alignmentRectInsets

var alignmentRectInsets: NSEdgeInsets

Methods

encode(with:)

public override func encode(with aCoder: NSCoder)

updateConstraints()

public override func updateConstraints()