-
Notifications
You must be signed in to change notification settings - Fork 3
LayerView
A layer-backed view with additional APIs for setting background color, border width, border color, and corner radius. Use if you do not need to do custom drawing. Supports animations.
open class LayerView: NSView
NSView
public override init(frame frameRect: NSRect)
public required init?(coder: NSCoder)
The background color of the view. Corresponds to the
backgroundColor
property of CALayer
. Animatable.
var backgroundColor = NSColor.clear
The default value is no color.
The width of the border around the view. Corresponds to the
borderWidth
property of CALayer
.
var borderWidth: BorderWidth
The default value is 0.
To animate, use animatableBorderWidthInPoints
or
animatableBorderWidthInPixels
.
An animatable version of the borderWidth
property. Values
are in points.
var animatableBorderWidthInPoints: CGFloat = 0
The fromValue
of the animation will be automatically set
to the current value of borderWidth
.
An animatable version of the borderWidth
property. Values
are in pixels.
var animatableBorderWidthInPixels: CGFloat = 0
The fromValue
of the animation will be automatically set
to the current value of borderWidth
.
The color of the border around the view. Corresponds to the
borderColor
property of CALayer
. Animatable.
var borderColor = NSColor.black
The default value is opaque black.
The radius of the rounded corners of the view. Corresponds to the
cornerRadius
property of CALayer
. Animatable.
var cornerRadius: CGFloat = 0
The default value is 0.
var wantsUpdateLayer: Bool
open override func encode(with aCoder: NSCoder)
open override func updateLayer()
open override func viewDidChangeBackingProperties()
open override class func defaultAnimation(forKey key: NSAnimatablePropertyKey) -> Any?
open override func animation(forKey key: NSAnimatablePropertyKey) -> Any?
Generated at 2020-11-27T07:13:09+0000 using swift-doc 1.0.0-beta.5.