swf

SWFrameButton

iOS7 Style UIButton with border

Showing:

Popularity

Downloads/wk

0

GitHub Stars

104

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

SWFrameButton

This UIButton subclass replicate single line border button see in iOS 7 App Store.

Screenshot

Installation

SWFrameButton is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SWFrameButton"

You may also quickly try the SWFrameButton example project with

pod try SWFrameButton

Requirements

Requires iOS 7.0+ and ARC.

Usage

SWFrameButton design to use tintColor to determine its color, so try to avoid set text color by setTitleColor:forState: it won't break your button, but may raise inconsistent highlighted/selected color state. Text Color property in Interface Builder will be ignore for this reason, use Tint property in view section instead.

Basic usage

SWFrameButton *button = [[SWFrameButton alloc] init];
[button setTitle:@"Green Tint Button" forState:UIControlStateNormal];
[button sizeToFit];
button.tintColor = [UIColor greenColor];

If you use Interface Builder, add a UIBUtton to your interface and set Class to SWFrameButton.

Use with storyboard

Customization

You can use customize SWFrameButton using UIAppearance

[[SWFrameButton appearance] setTintColor:[UIColor orangeColor]];
[[SWFrameButton appearance] setBorderWidth:1];
[[SWFrameButton appearance] setCornerRadius:10];

or set individual button style via property

SWFrameButton *button = [[SWFrameButton alloc] init];
button.tintColor = [UIColor orangeColor];
button.borderWidth = 1;
button.cornerRadius = 10;

Author

Sarun Wongpatcharapakorn (@sarunw)

License

SWFrameButton is available under the MIT license. See the LICENSE file for more info.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100