This repository has been archived by the owner on May 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding CocoaPods support, updating README.
- Loading branch information
1 parent
865e7f5
commit 3341af1
Showing
4 changed files
with
87 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'BTButton' | ||
s.version = '1.0.0' | ||
s.license = 'MIT' | ||
s.summary = 'A UIButton subclass with easy button styling!' | ||
s.homepage = 'https://github.com/bdbergeron/BTButton' | ||
s.authors = { 'Bradley David Bergeron' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/bdbergeron/BTButton.git', :tag => '0.1.0' } | ||
s.requires_arc = true | ||
|
||
s.platform = :ios, '7.0' | ||
|
||
s.source_files = 'BTButton/*.{h,m}' | ||
s.public_header_files = 'BTButton/*.h' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,54 @@ | ||
# BTButton | ||
|
||
BTButton is a UIButton subclass for iOS 7. With BTButton, you can create round buttons and rounded rect buttons with ease. | ||
BTButton is a UIButton subclass for iOS 7. Although many argue that one should not subclass UIButton, all BTButton does is add a couple methods that make styling buttons in iOS applcations much simpler. | ||
|
||
Take a look at the included demo app in order to get a full understanding of how BTButton works. | ||
|
||
## Installation | ||
|
||
To use BTButton in you projects, you can simply add `pod BTButton, '~> 1.0.0'` to your Podfile, if you're using CocoaPods. If you prefer the manual route, just add the contents of the BTButton folder to your project. Super simple! | ||
|
||
## Usage | ||
|
||
Taking inspiration from Apple's push to using NSAttributedStrings throughout iOS 7, BTButton uses one simple method to set the style of a button. The currently supported customizations are: | ||
|
||
* Corner Radius | ||
* Fill Color | ||
* Border Color | ||
* Border Width | ||
|
||
By using different combinations of these attributes, you can create a handful of different effects, such as a red button with a white label and a 5 pixel corner radius: | ||
|
||
```obj-c | ||
NSAttributedString *title = | ||
[[NSAttributedString alloc] initWithString:@"Button" | ||
attributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}]; | ||
|
||
BTButton *button = [BTButton new]; | ||
[button setStyleAttributes:@{BTButtonCornerRadiusName:@(5.0f), | ||
BTButtonFillColorName:[UIColor red]} | ||
forControlState:UIControlStateNormal]; | ||
[button setAttributedTitle:title forControlState:UIControlStateNormal]; | ||
[button sizeToFit]; | ||
``` | ||
## Credits | ||
Copyright (c) 2014 [Bradley David Bergeron](http://www.bradbergeron.com) | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |