Latest 0.1.2
Homepage https://github.com/quanvo87/WQNetworkActivityIndicator
License MIT
Platforms ios 8.0
Authors ,

WQNetworkActivityIndicator

Version
License
Platform
Swift

Provides an easy way to manage the Network Activity Indicator with multiple network requests.

Features

  • [x] Prevents a network request from prematurely hiding the Network Activity Indicator if there are still other network requests in progress
  • [x] Prevents errors in the event that show() and hide() calls become unbalanced
  • [x] Has an optional timeout built into show(), in case a network request takes too long, or the calls become unbalanced

Example

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

Installation

WQNetworkActivityIndicator is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'WQNetworkActivityIndicator'

Usage

Show the Network Activity Indicator:

WQNetworkActivityIndicator.shared.show()

Hide the Network Activity Indicator:

WQNetworkActivityIndicator.shared.hide()

Multiple network requests:

WQNetworkActivityIndicator.shared.show()

networkRequestA() {
    WQNetworkActivityIndicator.shared.hide()
}

WQNetworkActivityIndicator.shared.show()

networkRequestB() {
    WQNetworkActivityIndicator.shared.hide()
}

The Network Activity Indicator will stop showing only when both requests are done.

Force the Network Activity Indicator to hide:

WQNetworkActivityIndicator.shared.hide(force: true)

Change the timeout

The timeout defaults to 10 seconds. Set it to 0 to disable it:

WQNetworkActivityIndicator.shared.timeout = 0

Authors

Based off MXNetworkActivityIndicator.

License

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

Latest podspec

{
    "name": "WQNetworkActivityIndicator",
    "version": "0.1.2",
    "summary": "An easy way to manage the Network Activity Indicator with multiple network requests.",
    "description": "An easy way to manage the Network Activity Indicator with multiple network requests. Prevents network requests that are finishing from prematurely hiding the Network Activity Indicator if there are still other network requests in progress. Also has built in safety features like disabling the Network Activity Indicator after a timeout.",
    "homepage": "https://github.com/quanvo87/WQNetworkActivityIndicator",
    "screenshots": "https://raw.githubusercontent.com/quanvo87/WQNetworkActivityIndicator/master/WQNetworkActivityIndicator/Assets/screenshot.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "quanvo87": "[email protected]",
        "Wilson Ding": "[email protected]"
    },
    "source": {
        "git": "https://github.com/quanvo87/WQNetworkActivityIndicator.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.0.3",
    "source_files": "WQNetworkActivityIndicator/Classes/**/*"
}

Pin It on Pinterest

Share This