Swift Playground versions of select articles from Cocoa with Love.
- Statements, messages, reducers
- CwlLayout: a Swift wrapper around Auto Layout
- A view construction syntax
These playgrounds are all tested in Xcode 9.2.
I show how to structure programs around three tiers of computational units – statements, messages and reducers – and talk about the general problem of containing and isolating state that this restructuring aims to address.
This article originally appeared on the Cocoa with Love website: Statements, messages and reducers.
Note that the playground may take about 10 seconds to start while it compiles the associated "Sources" for the project.
I present a small file for handling layout, similar to UIStackView or NSStackView but built around efficient Swift syntax and the aim of composing full layouts as a single expression.
This article originally appeared on the Cocoa with Love website: CwlLayout: a Swift wrapper around Auto Layout.
In this article, I look at constructing Cocoa views in code using a unique syntax that offers dynamic and constant options with no syntactic overhead, supports parameters inherited through the class hierarchy, allows hundreds of optional parameters without pushing hundreds of defaulted parameters onto the stack, avoids parentheses, and avoids specifying types – all while remaining completely typesafe.
This article originally appeared on the Cocoa with Love website: A view construction syntax.
Note that the playground may take about 10 seconds to start while it compiles the associated "Sources" for the project.