Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Subclass of NSButton which has hover attributes

Resources

Stars

16 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages