Created
August 11, 2017 16:56
-
-
Save ncreated/6ec52e393bf3520c427908f045c96465 to your computer and use it in GitHub Desktop.
Medium blogpost snippet
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
private func setUp(settingSwitch: UISwitch, with toggle: Toggle) { | |
let (value, isBusy) = toggle.manage(change: settingSwitch.rx.isOn.changed.asObservable()) | |
// ... | |
let isSwitchDisabled = isBusy | |
.map { !$0 } | |
isSwitchDisabled | |
.drive(settingSwitch.rx.isEnabled) | |
.disposed(by: disposeBag) | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment