Deprecates `sharedInstance` on `ConcurrentMainScheduler` in favor of `instance`.

This commit is contained in:
Krunoslav Zaher 2015-12-28 01:07:45 +01:00
parent 62b25c538d
commit 3868268f44
2 changed files with 5 additions and 2 deletions

View File

@ -43,7 +43,7 @@ extension UITextView {
// Event needs to happen after text is changed. This is kind of a hacky way, but
// don't know any other way for now.
let throttledAnyOtherEvent = anyOtherEvent
.throttle(0, scheduler: MainScheduler.sharedInstance)
.throttle(0, scheduler: MainScheduler.instance)
.takeUntil(self?.rx_deallocated ?? Observable.just())
return Observable.of(textChangedEvent.map { _ in () }, throttledAnyOtherEvent)

View File

@ -35,10 +35,13 @@ public final class ConcurrentMainScheduler : SchedulerType {
_mainScheduler = mainScheduler
}
@available(*, deprecated=2.0.0, message="Please use `ConcurrentMainScheduler.instance`")
public static let sharedInstance = ConcurrentMainScheduler(mainScheduler: MainScheduler.instance)
/**
Singleton instance of `ConcurrentMainScheduler`
*/
public static let sharedInstance = ConcurrentMainScheduler(mainScheduler: MainScheduler.sharedInstance)
public static let instance = ConcurrentMainScheduler(mainScheduler: MainScheduler.instance)
/**
Schedules an action to be executed immediatelly.