Swift Coding
Published in

Swift Coding

The observer pattern in Swift

The observer pattern is extremely important in Swift, and is implemented in iOS via the use of Notifications and Key-Value Observing (KVO). This guide is simply about a Swift implementation, and will help you to think about how this can be applied to a variety of situations when coding in Swift.

When using the MVVM architecture (for example), we need to let the model communicate with the view without direct…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store