Week 4: Reactive iOS Applications with Key-Value Observing

Swiftos
Geek Culture
Published in
4 min readApr 11, 2021

--

Photo by Hannah Tasker on Unsplash

Hi developers,

Reactive programming is getting more and more attention since Apple announced its Combine framework. Unfortunately, however, the Combine framework is only available for iOS 13.0+. In the meantime, we can still install the RxSwift framework. But the RxSwift framework is huge. It may increase the size of the app unnecessarily, especially if we are only using it to accomplish some simple tasks. Here’s when Key-Value Observing comes into play.

In this tutorial, we are going to build a reactive application using Key-Value Observing. Please note that this tutorial will not focus on the implementation of the UI, so feel free to create your own UI.

What’s Key-Value Observing?

Key-Value Observing allows the program to observe changes to the properties of an object. Its usages are very similar to didSet and willSet, both of which allow the program to observe changes to an object internally, but Key-Value Observing is usually used for observing an object externally.

Overview

--

--

Swiftos
Geek Culture

I publish short iOS development tutorials on a weekly basis. For all content, head over to: https://www.patreon.com/Swiftos