Latest 1.0.1
Homepage https://github.com/needbee/uibutton-activity
License MIT
Platforms ios 6.0, requires ARC
Authors

uibutton-activity

UIButton that displays an activity indicator when disabled.

Demo

The demo/ folder contains a demo project showing UIButton+Activity in use. Open and run it.

Usage

Import "UIButton+Activity.h". Then, on any button you want to show an activity indicator when disabled, either call

[_button useActivityIndicator:YES];

If your button lives in a storyboard/xib, you can also set the property on it there.

The activity indicator usually works best if you also set up the button to hide its title in the disabled state:

[_button setTitle:@"" forState:UIControlStateDisabled];

Then, to show the activity indicator, just disable the button as normal:

_button.enabled = NO;

Compatibility

This class has been tested back to iOS 6.0.

Implementation

This class is implemented by hiding and showing a UIActivityIndicator subview when the button’s enabledness changes.

License

This code is released under the MIT License. See the LICENSE file for details.

Latest podspec

{
    "name": "UIButton+Activity",
    "version": "1.0.1",
    "summary": "UIButton that displays an activity indicator when disabled.",
    "homepage": "https://github.com/needbee/uibutton-activity",
    "license": "MIT",
    "authors": {
        "Josh Justice": "[email protected]"
    },
    "source": {
        "git": "https://github.com/needbee/uibutton-activity.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true,
    "source_files": [
        "src",
        "src/**/*.{h,m}"
    ]
}

Pin It on Pinterest

Share This