SYFlatButton 1.4

SYFlatButton 1.4

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Nov 2017

Maintained by Sunnyyoung.



  • By
  • Sunnyyoung

Description

A customized NSButton with modern flat style like bootstrap.

Screenshot

Installation

Requirement

macOS 10.9 and above.

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.