Fab

open class Fab: NSObject

Undocumented

  • The type of the button.

    See more

    Declaration

    Swift

    public enum Kind
  • The action the button should perform when tapped.

    Declaration

    Swift

    open var action: FabAction = { $0.toggleMenu() }
  • The button’s diameter.

    Declaration

    Swift

    public var diameter: CGFloat = 50
  • Undocumented

    Declaration

    Swift

    public var itemOffset: CGFloat = 10
  • The distance between the button and first item.

    Declaration

    Swift

    public var firstItemOffset: CGFloat = 10
  • The value to scale the button to when the cursor enters its bounds.

    Declaration

    Swift

    public var mouseOverScale: CGFloat = 1.05
  • The angle, in radians, to rotate the button when moused-over and active.

    Declaration

    Swift

    open var mouseOverRotation: CGFloat = CGFloat.pi / 4
  • The button’s background color.

    Declaration

    Swift

    open var backgroundColor: NSColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
  • The button’s background color.

    Declaration

    Swift

    open var backgroundColorSelected: NSColor = #colorLiteral(red: 1, green: 0.231372549, blue: 0.1882352941, alpha: 1)
  • Whether the button’s drop shadow should be hidden when active (expanded).

    Declaration

    Swift

    open var hidesShadowWhenActive: Bool = true
  • Whether to present the NSVisualEffectView when the button is active (expanded).

    Declaration

    Swift

    public var usesVisualEffectBackground: Bool
  • The key-equivalent of the Fab.

    Declaration

    Swift

    public var keyEquivalent: FabKeyEquivalent
  • The button’s drop shadow.

    Declaration

    Swift

    public var shadow: NSShadow?
  • The height of the entire expanded content. Can be used to determine the minimum window size.

    Declaration

    Swift

    open var contentHeight: CGFloat
  • Indicates if the button is active (showing its items).

    Declaration

    Swift

    fileprivate(set) open var active: Bool = false
  • The type of the button.

    Declaration

    Swift

    public let kind: Kind
  • Returns the VisualEffectButton.

    Note

    Only a non-nil value when the button kind is .visualEffect.

    Declaration

    Swift

    public var visualEffectButton: VisualEffectButton?
  • The button that will be presented to the user.

    Declaration

    Swift

    public var floatButton: CircularButton
  • Blur effect that will be presented when the button is active.

    Declaration

    Swift

    public var visualEffectView: NSVisualEffectView!
  • Whether the Fab is animating to a different state.

    Declaration

    Swift

    public private(set) var isAnimating: Bool = false
  • Undocumented

    Declaration

    Swift

    public init(attachedTo view: NSView, kind: Kind, items: [FabItem]?)
  • Undocumented

    Declaration

    Swift

    required public init(coder aDecoder: NSCoder)
  • Undocumented

    Declaration

    Swift

    open func setTitle(_ title: NSAttributedString)
  • Undocumented

    Declaration

    Swift

    open func setImage(_ image: NSImage)
  • Presents or hides all the Fab’s actions

    Declaration

    Swift

    open func toggleMenu()
  • Dismisses the Fab. Does nothing if the Fab is not presented.

    Declaration

    Swift

    public func dismiss()