Skip to content

vc7/RxActivityIndicator

 
 

Repository files navigation

RxActivityIndicator

CocoaPods Compatible Carthage Compatible Platform Build Status codecov

About

The ActivityIndicator class monitors Observables and will itself emit true if any have not completed, or false if all have completed. This is useful, for instance, when wanting to show network activity in the status bar while one or more Observables are still active.

Usage

Check out the Documentation, the examples below, or the Example App.

let signingIn = ActivityIndicator()

let signedIn = loginButtonTap.withLatestFrom(usernameAndPassword)
    .flatMapLatest { (username, password) in
        return API.signup(username, password: password)
            .trackActivity(signingIn)
    }
}

signingIn.asDriver()
    .drive(UIApplication.shared.rx.isNetworkActivityIndicatorVisible)
    .addDisposableTo(disposeBag)

Example App

This repo contains an Example App with interactive examples.

To use the Example App:

cd ExampleApp
pod install

Open the project located in ExampleApp/ with Xcode and build/run it.

Requirements

  • Xcode 8.0
  • Swift 3.0

Installation

Tested with pod --version: 1.1.1

In your Podfile:

use_frameworks!

target "YOUR_TARGET_NAME" do
  pod "RxActivityIndicator"
end

Replace YOUR_TARGET_NAME and then, in the same directory, run:

pod install

Tested with carthage version: 0.18

Add this to Cartfile

github "RxSwiftCommunity/RxActivityIndicator"

In the same directory, run:

carthage update

Link/Embed frameworks as explained here. Besides linking RxActivityIndicator, you will also need to link RxSwift and RxCocoa.

Contributing

Help is always appreciated!

git clone git@github.com:RxSwiftCommunity/RxActivityIndicator.git
cd RxActivityIndicator

Or use your own forked repo.

carthage bootstrap

This is necessary in order to be able to build the framework on its own and run tests. However, if you prefer, you can instead develop it while it's within another project.

Before submitting a PR, please make sure that the tests pass.

About

Helpful classes and extensions for RxSwift

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 87.8%
  • Ruby 7.5%
  • Objective-C 4.7%