Introducing VFL

There are a plethora of wrappers around the AutoLayout engine. They all seem to provide convenience towards making the layout code look cleaner. In all fairness this is due to the fact that the first version of NSLayoutContraint API was very verbose. But I remember when Apple announced the constraint based layout they were equally excited about providing a what they referred to as ‘ascii based constraints’. The idea is to create constraints between siblings and parent UI elements in a string based format. They even provide a guide to “Visual Format Language” aka VFL.

Inventing EnumArray

So today I happened to need something which has an storage of an Array but can not grow. And instead of Int I need a named lookup, like a Dictionary. But then again I don’t want to deal with Optionals. I want the initial values to be populated during the init so that lookups can never be nil. Does such a thing already exists? In Swift I mean. I guess not, so obviously the next step is to make such a thing. I’m calling it EnumArray.

A minimal implementation of State and Binding with Swift

One of my most favorite thing about SwiftUI is neither the declarative API nor the mystical fancy syntax but rather the philosophy of one directional flow of data and event. I’ve been trying to put that philosophy into practice for quite a while now with whatever framework I use.

Adapters in Swift

Any professional software developer knows that the simplest solution in building software is sometimes just to wrap an existing solution with the expected client interface and be done with it. This pattern is so common they even gave it a name, Adapter Pattern.