Latest 1.0.1
Homepage https://github.com/dtrisciuoglio/FLLActivityIndicatorController
License MIT
Platforms ios 8.0
Authors

FLLActivityIndicatorController is an iOS class that displays an indicator while work is being done in a background thread.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

FLLActivityIndicatorView

// Initialize the activity indicator view
CGRect frame = CGRectMake(40, 40, 40, 40);
FLLActivityIndicatorView *activityIndicatorView = [[FLLActivityIndicatorView alloc] initWithFrame:frame];

// Set the line width of the activity indicator view
activityIndicatorView.lineWidth = 4;

// Set the stroke color of the activity indicator view
activityIndicatorView.strokeColor = [UIColor redColor];

// Add it as a subview
[self.view addSubview:activityIndicatorView];

...

// Start animation
[activityIndicatorView startAnimating];

...

// Stop animation
[activityIndicatorView stopAnimating];

FLLActivityIndicatorController

// Create the NSURLSessionConfiguration and then create a session with that configuration.
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];

// Create the NSURLRequest using either an NSURL
NSURL *url = [NSURL URLWithString:@"https://httpbin.org/get"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];

// Initialize the shared instance activity indicator controller.
FLLActivityIndicatorController *activityIndicatorController = [FLLActivityIndicatorController activityIndicatorController];

// Show the activity indicator
[activityIndicatorController show];

// Call the web service
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
                                                // Hide the activity indicator
                                                [activityIndicatorController hide];
                                            }];
[dataTask resume];

Also support xib and storyboard

The lineWidth and strokeColor properties can even be set after animating has been started, which you can observe in the included example project.

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

CocoaPods

You can use CocoaPods to install FLLActivityIndicatorController by adding it to your Podfile:


   platform :ios, '8.0'
   use_frameworks!
   pod "FLLActivityIndicatorController"

Author

Dario Trisciuoglio, [email protected]

License

FLLActivityIndicatorController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "FLLActivityIndicatorController",
    "version": "1.0.1",
    "summary": "An iOS activity indicator view.",
    "description": "`FLLActivityIndicatorController` is an iOS class that displays an indicator while work is being done in a background thread.",
    "homepage": "https://github.com/dtrisciuoglio/FLLActivityIndicatorController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dario Trisciuoglio": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dtrisciuoglio/FLLActivityIndicatorController.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Source/**/*.{h,m}",
    "resource_bundles": {
        "FLLActivityIndicatorController": "Assets/**/*.{xib,storyboard}"
    }
}

Pin It on Pinterest

Share This