It's very simple.
CADisplayLink.rx.link()
.subscribe(onNext: { _ in
// Your freedom
})
.disposed(by: disposeBag)Of course, you can set RunLoop, Mode and FPS. 👌
CADisplayLink.rx.link(to: .current, forMode: .defaultRunLoopMode, fps: 30)
// OR
RxDisplayLink(to: .current, forMode: .defaultRunLoopMode, fps: 30)- Swift 4.2
Add the following to your Podfile:
pod "RxDisplayLink"
use_frameworks!Add the following to your Cartfile:
github "KyoheiG3/RxDisplayLink"Follow me 🎉
Under the MIT license. See LICENSE file for details.