Views are a foundational building block in iOS apps.

As you gain more experience, or start to work on complex projects, the way you write views will evolve and you will start paying more attention to design patterns, testability and consistency. There are many approaches to try out! Our experience at iZettle led us to an interesting functional way of thinking about views that we would like to share.

Let’s assume we have a hierarchy of views that are reused in a few places. It consists of a label and a text field, they look like this:

Image for post
Image for post

How would we usually organize the code related to them? …

About

Nataliya Patsovska

Caring, thinking and talking about software engineering. Currently: writing and testing UI components @iZettle 🙃. Ex iOS @Spotify🎵

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