A video series exploring functional programming and Swift.
#17 • Monday May 28, 2018 • Subscriber-only

Styling with Overture

We revisit an old topic: styling UIKit components. Using some of the machinery we have built from previous episodes, in particular setters and function composition, we refactor a screen’s styles to be more modular and composable.

This episode builds on concepts introduced previously:

#17 • Monday May 28, 2018 • Subscriber-only

Styling with Overture

We revisit an old topic: styling UIKit components. Using some of the machinery we have built from previous episodes, in particular setters and function composition, we refactor a screen’s styles to be more modular and composable.

This episode builds on concepts introduced previously:


Subscribe to Point‑Free

This episode is for subscribers only. To access it, and all past and future episodes, become a subscriber today!

See subscription optionsorLog in

Sign up for our weekly newsletter to be notified of new episodes, and unlock access to any subscriber-only episode of your choosing!

Sign up for free episode

Introduction

Today’s episode is a new format where we take some real-world code and chip away at it to make it a little bit nicer. In this episode we’re going to focus on styling, a topic we’ve covered before, but we’re going to build on it with concepts from other, more recent episodes. In that episode, we showed how to style UIKit components using simple functions, and how function composition allowed us to layer these styles and compose them together. Later, we did a series of episodes on setters (1, 2, 3) where we showed that setters are wonderful, composable units that play nicely with Swift language-level features. Even later, we covered composition without operators, where we focus on composition as such an essential feature of functional programming that we shouldn’t let custom operators get in the way of embracing them.

We’re going to bring all of these ideas into one big refactor of a screen from the hypothetical, TBD, far-future Point-Free iOS app.

Subscribe to Point-Free

👋 Hey there! Does this episode sound interesting? Well, then you may want to subscribe so that you get access to this episodes and more!

Chapters
Introduction
00:05
Pre-refactor
01:24
Magic numbers
04:08
Reusable margins
06:37
Reusable stack view styles
10:05
Reusable button styles
14:36
What’s the point?
26:24