Dongjian413 / SYFlatButton

A customized NSButton with modern flat style like bootstrap.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SYFlatButton

Build Status License MIT Platform info

Description

A customized NSButton with modern flat style like bootstrap.

Screenshot

Installation

Requirement

macOS 10.12 and above.

Cocoapods

  1. Add pod 'SYFlatButton' to your podfile
  2. Run pod install

Manual

Dragging SYFlatButton.h and SYFlatButton.m to your project.

Usage

Interface Builder

  1. Create a NSButton
  2. Set its Button Style to Square in order to change the button's height
  3. Set its Button Class to SYFlatButton
  4. Config the styles from the inspector

Programmatically

See more customizable style from SYFlatButton.h

SYFlatButton *button = [[SYFlatButton alloc] initWithFrame:CGRectMake(20.0, 20.0, 60.0, 30.0)];
button.title = @"Code";
button.momentary = YES;
button.cornerRadius = 4.0;
button.backgroundNormalColor = [NSColor blueColor];
button.backgroundHighlightColor = [NSColor redColor];
[self.view addSubview:button];

Credit

Inspired by FlatButton.

License

The MIT License.

About

A customized NSButton with modern flat style like bootstrap.

License:MIT License


Languages

Language:Objective-C 97.0%Language:Ruby 3.0%