GithubHelp home page GithubHelp logo

kesavalakkireddy / swframebutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sarunw/swframebutton

0.0 1.0 0.0 3.86 MB

iOS7 Style UIButton with border

License: MIT License

Swift 3.14% Ruby 2.59% Objective-C 94.27%

swframebutton's Introduction

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.corderRadius = 10;

Author

Sarun Wongpatcharapakorn (@sarunw)

License

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

swframebutton's People

Contributors

sarunw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.