Latest 0.2.2
Homepage https://github.com/piemonte/PBJActivityIndicator
License MIT
Platforms ios 6.0, requires ARC
Authors

PBJActivityIndicator

PBJActivityIndicator

‘PBJActivityIndicator’ is an iOS component for displaying the status bar loading indicator efficiently across multiple objects.

When integrated, mobile apps that perform a variety of network requests can easily display an indication of activity without flickering or incorrect loading state. This can be accomplished by calling into ‘PBJActivityIndicator’ before a request is sent and then after request succeeds or fails.

Please review the release history for more information. If you have questions or ideas, the github issues page is a great means to start a discussion but also allows others to benefit and chime in on the project too.

Build Status
Pod Version

Installation

CocoaPods is the recommended method of installing PBJActivityIndicator, just add the following line to your Podfile:

Podfile

pod 'PBJActivityIndicator'

Usage

The activity indicator singleton is provided for convenience, using an instance variable is also just as effective.

#import "PBJActivityIndicator.h"

    // enable the activity indicator for the integer type, 'MyRequestTypeHttpGet'
    [[PBJActivityIndicator sharedActivityIndicator] setActivity:YES forType:MyRequestTypeHttpGet];

    // perform some type of loading request, disable the indicator in the completion blocks or delegate callback
    [dataRequester requestDataWithSuccessHandler:^() {

        // disable indicator on success
        [[PBJActivityIndicator sharedActivityIndicator] setActivity:NO forType:MyRequestTypeHttpGet];

    } failureHandler:^() {

        // disable indicator on failure
        [[PBJActivityIndicator sharedActivityIndicator] setActivity:NO forType:MyRequestTypeHttpGet];

    }];

Another technique for integrating ‘PBJActivityIndicator’ is to create a block that sets the activity within a particular component.

#import "PBJActivityIndicator.h"
    PBJActivityIndicatorBlock activityIndicatorBlock = ^(BOOL activity) {
        // Tip: it is possible to add logging particular to the activity here
        [[PBJActivityIndicator sharedActivityIndicator] setActivity:activity forType:MyRequestServiceType];
    };

Within that request service object, call the block to activate the appropriate state.

    // enable the indicator before making a request for the service 'MyRequestServiceType'
    if (activityIndicatorBlock)
        activityIndicatorBlock(YES);
    // disable the indicator after the request succeeds or fails
    if (activityIndicatorBlock)
        activityIndicatorBlock(NO);

License

PBJActivityIndicator is available under the MIT license, see the LICENSE file for more information.

Latest podspec

{
    "name": "PBJActivityIndicator",
    "version": "0.2.2",
    "summary": "iOS component for efficient status bar activity indication.",
    "homepage": "https://github.com/piemonte/PBJActivityIndicator",
    "license": "MIT",
    "authors": {
        "Patrick Piemonte": "[email protected]"
    },
    "source": {
        "git": "https://github.com/piemonte/PBJActivityIndicator.git",
        "tag": "v0.2.2"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "Source",
    "requires_arc": true,
    "screenshots": "https://raw.github.com/piemonte/PBJActivityIndicator/master/PBJActivityIndicator.gif"
}

Pin It on Pinterest

Share This