Latest 1.2.1
Homepage https://github.com/ivanbruel/RxTimer
License MIT
Platforms ios 8.0
Dependencies RxSwift
Authors

RxTimer provides an easy to use RxSwift binding for NSTimer.

Usage

1 second default timer

NSTimer.rx_timer
  .subscribeNext { _ in
    print("timer triggered")
  }
  .addDisposableTo(disposeBag)

Any number of seconds

NSTimer.rx_timer(10)
  .subscribeNext { _ in
    print("timer triggered")
  }
  .addDisposableTo(disposeBag)

Skip first event to ignore trigger upon subscribing

NSTimer.rx_timer(10)
  .skip(1)
  .subscribeNext { _ in
    print("timer triggered")
  }
  .addDisposableTo(disposeBag)

Take(n) to cancel the timer after n number of calls

NSTimer.rx_timer(10)
  .take(10)
  .subscribeNext { _ in
    print("timer triggered")
  }
  .addDisposableTo(disposeBag)

Installing

CocoaPods

pod 'RxTimer'

And that’ll be 👌

License

MIT License.

Latest podspec

{
    "name": "RxTimer",
    "version": "1.2.1",
    "summary": "RxTimer adds RxSwift NSTimer bindings.",
    "description": "RxTimer adds RxSwift NSTimer bindings. This allows you to trigger events reactively with a timer.",
    "homepage": "https://github.com/ivanbruel/RxTimer",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ivan Bruel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ivanbruel/RxTimer.git",
        "tag": "1.2.1"
    },
    "social_media_url": "https://twitter.com/ivanbruel",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "RxTimer/Classes/**/*",
    "dependencies": {
        "RxSwift": [
            "~> 3.1"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This