0
任何人都知道「startWith」函數是什麼?ReactiveCocoa 5.0中的「startWith」發生了什麼?
我想學習使用4.x版本的書的reactivecocoa。該示例使用startWith爲datePicker控件強制使用一個值。
任何人都知道「startWith」函數是什麼?ReactiveCocoa 5.0中的「startWith」發生了什麼?
我想學習使用4.x版本的書的reactivecocoa。該示例使用startWith爲datePicker控件強制使用一個值。
現在有版本startWithValues
,startWithFailed
,startWithCompleted
和startWithInterrupted
在您只關心一種特定類型的事件的情況下。
如果你需要更多或全部事件,使用需要一個Observer
並在該事件的開關版本start
producer.start { event in
switch event {
case let .value(value):
// Handle value
case let .failed(err):
// Handle error
case .completed:
// Handle completed
case .interrupted:
// Handle interrupted
}
}