Skip to content

sheldonlyr/KBButton

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#KBButton

KBButton is a subclass of NSButton. It was adapted from http://github.com/mattlawer/BButton to work under Cocoa on Mac OS X.

Install

Use CocoaPods and add to your Podfile

pod 'KBButton',
    :git    => '[email protected]:dsci/KBButton.git',
    :branch => 'master'

Usage

  1. Create a NSButton instance in interface builder.
  2. Set the class of the NSButton to KBButton

Changing the Color programatically

  1. Connect NSButton to IBOutlet through Interface Builder
  2. call [[button cell] setKBButtonType:BButtonTypeDefault] in awakeFromNib. In the example this is done in KBAppDelegate.m

Using a custom color

Follow step 1 of the Changing the Color programatically section

Then call in awakeFromNib:

- (void)awakeFromNib {
    NSColor *facebookColor = [NSColor colorWithCalibratedRed:0.178
                                                       green:0.268
                                                        blue:0.525
                                                       alpha:1.000];
	[[button cell] setKBButtonColor: facebookColor];   
}

Using a custom text color

Follow step 1 of the Changing the Color programatically section. You may want to use your own color.

Then call in awakeFromNib:

[[button cell] setKBButtonTextColor:[NSColor blackColor]];

Using a border color

Follow step 1 of the Changing the Color programatically section.

Then call in awakeFromNib:

[[button cell] setKBButtonBorderColor: [NSColor whiteColor]];

License

This library is licensed under the MIT license.

Contributing

If you would like to contribute or could improve the code, please submit a pull request or issue.

About

twitter button xcode project with demo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 77.6%
  • Ruby 22.4%