O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

States

In our application, we need to manage states to keep the State management code as declarative as possible. We will use a library named Delta (https://github.com/conqueror/Delta/blob/master/documentation/getting-started.md).

Delta will be used along with ReactiveCocoa and ReactiveSwift to manage states and State changes reactively. The code is as follows:

import ReactiveCocoa import ReactiveSwift import Delta extension MutableProperty: Delta.ObservablePropertyType {     public typealias ValueType = Value } 

In the preceding code, we extend the ReactiveSwift library's MutableProperty by conforming to Delta.ObservablePropertyType.

The ObservablePropertyType protocol must be implemented by the State that is held by Store. To use a custom ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required