SkillAgentSearch skills...

JZHoverNSButton

Subclass of NSButton which has hover attributes

Install / Use

/learn @Swift-Kit/JZHoverNSButton
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

JZHoverNSButton

Subclass of NSButton which has hover attributes. Currently support up to Swift 2.0.

Usage

Drag JZHoverNSButton.swift to your project

Either init with one of the initializer or create via Interface Builder and set the class of NSButton as JZHoverNSButton

This NSButton class supports two ways of hovering:

  • Background image
myButton.setImages(NSColor.blackColor()!,
            imageOriginal: NSImage(named: "original-button")!,
            imageHover: NSImage(named: "hover-button")!)
  • Background color
myButton.setColors(NSColor.blackColor()!,
			hoverBgColor: NSColor.whiteColor()!)

Attributed String

It also supports attributed string via these two setters

myButton.setText(str, NSColor.whiteColor(), size: 15)

OR

myButton.setText(str, NSColor.whiteColor())

License

MIT, see license file

View on GitHub
GitHub Stars16
CategoryDevelopment
Updated3y ago
Forks4

Languages

Swift

Security Score

75/100

Audited on Dec 8, 2022

No findings