Created
April 20, 2016 06:46
-
-
Save bricklife/a8e963444dc7aa338d10018cde41aa71 to your computer and use it in GitHub Desktop.
うおー、HistoricalScheduler便利だ! #CodePiece #rxswift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import RxSwift | |
let now = NSDate() | |
let scheduler = HistoricalScheduler(initialClock: now) | |
_ = Observable<Int>.interval(0.5, scheduler: scheduler) | |
.subscribe { print($0) } | |
scheduler.advanceTo(now.dateByAddingTimeInterval(1)) | |
// Next(0) | |
// Next(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment