SYFlatButton
Description
A customized NSButton
with modern flat style like bootstrap.
Screenshot
Installation
Requirement
macOS 10.12 and above.
Cocoapods
- Add
pod 'SYFlatButton'
to your podfile - Run
pod install
Manual
Dragging SYFlatButton.h
and SYFlatButton.m
to your project.
Usage
Interface Builder
- Create a
NSButton
- Set its
Button Style
toSquare
in order to change the button's height - Set its
Button Class
toSYFlatButton
- 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.