Swift : Introduction to Combine Framework.

Saad El Oulladi
4 min readJul 29, 2019

Declarative programming has gained a lot of interest in the software industry during the last years. It’s being already used in iOS a long time using external libraries like RXSwift and ReactiveCocoa. So this was a matter of time until apple creates a native library for that.

Now iOS 13 comes with a new UI framework, SwiftUI, which is based on a declarative framework called Combine. It means from now on, data binding and reactive components will be easier to do, and no external library will be needed.

What do we mean by declarative programming ?

First before talking about Combine, let’s explain what do we mean by declarative programming.

Declarative programming (which is the opposite of Imperative programming) provides an abstraction over details of the instructions a software will be doing. in other words, we only define what need’s to be done. instead of writing in our code how a certain task should be done.

There is another big difference between those two ways of programming.

  • In imperative we have at a given moment values, or so called state.

--

--