TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | May 2015 |
Maintained by Guilherme Araújo.
CocoaPods (recommended)
Add the following line to your Podfile
:
pod 'GUIRoundProgressButton', '~> 0.0.2
And then add #import <GUIRoundProgressButton.h>
to your view controller.
Manual
Copy the folders Classes
to your project, then add #import "GUIRoundProgressButton.h"
to your view controller.
To use it, you should create a view controller that extends GUIRoundProgressButton
. That can be done in two ways:
UIView
object to you viewGUIRoundProgressButton
IBOutlet
in your view or view controller source fileGUIRoundProgressButton *button = [GUIRoundProgressButton buttonWithCenter:<#CGPoint#> radius:<#CGFloat#>];
[self.view addSubview:button];
These are the methods you can use to change the look and feel of your button. The "touch" methods relate to the color while the button is being pressed by the user.
- (CGFloat)setContentPadding;
- (CGFloat)setBorderWidth;
- (UIColor *)setBorderColor;
- (UIColor *)setTouchBorderColor;
- (UIColor *)setForegroundColor;
- (UIColor *)setTouchForegroundColor;
- (UIColor *)setProgressIndicatorColor;
- (void)setImage:(UIImage *)image;
- (void)setText:(NSString *)text;
- (void)setAttributedText:(NSAttributedString *)text;
NOTE: either the image or the text will be visible. If both are set, the one which was set last is the one that will be used.
This is the action the button will perform once it has been tapped.
- (void)setActionBlock:^(GUIRoundProgressButton *weakButton);
[button setActionBlock:^(GUIRoundProgressButton *weakButton) {
// Perform your tasks here
// At the end, call finish using the weak reference to prevent memory leaks
[weakButton finish];
}];
NOTE: do not forget to call the finish
method at the end of your tasks. Use the weak reference to the button to prevent memory leaks.