Latest 0.0.2
Homepage https://github.com/guilhermearaujo/GUIRoundProgressButton
License MIT
Platforms ios 8.0, requires ARC
Authors

CocoaPods [CocoaPods]() [CocoaPods]()

Animated gif

Installation

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.

Usage

To use it, you should create a view controller that extends GUIRoundProgressButton. That can be done in two ways:

Using the Interface Builder

  • Add a UIView object to you view
  • Change its class to GUIRoundProgressButton
  • Create an IBOutlet in your view or view controller source file

Adding the button programmatically

  • Create an instance: GUIRoundProgressButton *button = [GUIRoundProgressButton buttonWithCenter:<#CGPoint#> radius:<#CGFloat#>];
  • Add it as a subview: [self.view addSubview:button];

Customizing

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 and while the action is in progress.

Content Padding

- (CGFloat)setContentPadding;

Border

- (CGFloat)setBorderWidth;
- (UIColor *)setBorderColor;
- (UIColor *)setTouchBorderColor;

Color

- (UIColor *)setForegroundColor;
- (UIColor *)setTouchForegroundColor;

Progress Indicator

- (UIColor *)setProgressIndicatorColor;

Image

- (void)setImage:(UIImage *)image;

Text

- (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.

Action

This is the action the button will perform once it has been tapped.

- (void)setActionBlock:^(GUIRoundProgressButton *weakButton);
Example
;
}];

NOTE: do not forget to call the finish method at the end of your tasks. Use the weak reference to the button to prevent retain cycles.

Latest podspec

{
    "name": "GUIRoundProgressButton",
    "version": "0.0.2",
    "summary": "GUIRoundProgressButton is a good looking, round button with a progress indicator.",
    "homepage": "https://github.com/guilhermearaujo/GUIRoundProgressButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Guilherme Arau00fajo": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/guilhermearaujo/GUIRoundProgressButton.git",
        "tag": "0.0.2"
    },
    "source_files": [
        "GUIRoundProgressButton/Classes",
        "GUIRoundProgressButton/Classes/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This