Latest 0.2.1
Homepage https://github.com/marcoscurvello/MCActivityButton
License MIT
Platforms ios 7.0, requires ARC
Authors

CI Status
Version
license MIT

MCActivityButton is an objective-c UIButton subclass that animates a standard iOS activity indicator with a custom title when tapped.

This is currently a work in progress and has not been thoroughly tested. Use at your own risk.

Demo

Requirements

  • ARC

Installation

CocoaPods

Podfile

pod "MCActivityButton"

Usage

#import <MCActivityButton/MCActivityButton.h>

Create a MCActivityButton object and customize it.

MCActivityButton *button = [MCActivityButton alloc] initWithFrame:CGRectMake()];

Once you have your button object customize it like so:

// Default UIButton customization
 forState:UIControlStateNormal];
button.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:14];
button.backgroundColor = [UIColor colorWithRed:0.000 green:0.294 blue:0.624 alpha:1.000];

// Initial and Action Button Title
button.initialTitle  = @"Login";
button.activityTitle = @"Logging in...";

// Locks Subsequent Button Clicks
button.lockTaps = YES;

// Button title animation duration
button.buttonAnimationDuration = 0.5;

// Optional Rounded Edges
button.layer.cornerRadius = 5;
button.clipsToBounds = YES;

// Customize Activity Indicator
button.activityIndicatorColor  = [UIColor whiteColor];
button.activityIndicatorMargin = 6;
button.activityIndicatorScale  = 0.8;

// Then Add Your Button to the view
[self.view addSubview:button];

// Force button to return to it's initial state
;

To-do’s

  • Fully implement view tests.
  • Dynamic frame calculations.
  • Different animation styles.
  • Different activity indicator styles.
  • Background and title color change.
  • Swift version is underway, with all the above mentioned to-do’s.

Author

Marcos Curvello, [email protected]

License

MCActivityButton is available under the MIT License. See the LICENSE file for more info.

Latest podspec

{
    "name": "MCActivityButton",
    "version": "0.2.1",
    "summary": "UIButton subclass that animates a custom message with an activity indicator.",
    "description": "  `MCActivityButton` is an objective-c `UIButton` subclass that animates a standard iOS activity indicator with a custom title when tapped.'nn                       * Markdown format.n                       * Don't worry about the indent, we strip it!n",
    "homepage": "https://github.com/marcoscurvello/MCActivityButton",
    "screenshots": [
        "https://raw.githubusercontent.com/marcoscurvello/MCActivityButton/master/Screenshots/screenshot0.png",
        "https://raw.githubusercontent.com/marcoscurvello/MCActivityButton/master/Screenshots/screenshot1.png"
    ],
    "license": "MIT",
    "authors": {
        "Marcos Curvello": "[email protected]"
    },
    "source": {
        "git": "https://github.com/marcoscurvello/MCActivityButton.git",
        "tag": "0.2.1"
    },
    "social_media_url": "https://twitter.com/mrcurvello",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "MCActivityButton": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This