The following is a snippet of tutorial code that binds a toggle switch to an activity indicator:
aSwitch.rx.value
.map { !$0 }
.bind(to: activityIndicator.rx.isHidden)
.disposed(by: disposeBag)
aSwitch.rx.value.asDriver()
.drive(activityIndicator.rx.isAnimating)
.disposed(by: disposeBag)
What is the syntax of binding to a private func()?
I want to be able to several things beyond merely flipping a boolean value.
Specifically, I would like to:
- Toggle the title of another button;
- Enable & clear a UITextView; and
- Change a UILabel text.
Or is it better in this case, to merely use the familiar toggle-button @IBAction paradigm?