Jan 5 2017
Application Design: Enums (with bonus tuple)
In the zoom example app, to make life easier for me, I went for a cyclical zoom: 2x magnification, 3x magnification, 1x magnification. When Apple first announced Swift, I liked many things about it, but the thing that made me swoon was enums. Swift enums are wonderful tools to shape your application flow. Here, we […]
Nov 7 2017
Proof of Concept: Enum with associated function
In Swift, functions are first class citizens The above does not come as a surprise. We’re using closures as callback handlers, and store them – frequently as optionals – save them, pass them around. I’ve used them as a variable in an enum: depending on the value of the enum, I return a different closure. […]
By Extelligent Cocoa • Application Design • • Tags: closures, enums, NSAlert