An implementation of a free
zip function that will take three
Sequence types and return another
Sequence whose elements are each three-item tuples built from the elements of three underlying sequences. It's the
zip from the standard library but for three sequences.
A checklist to help me (and possibly you) remember what to do to update a Cocoapod that you own.
The advantages of working in a type-safe language extend beyond the compiler complaining that it received an
Double but expected an
Int. Developers can use the Swift type system to enforce complex invariants rather than relying on mere conventions or other fragile means, but reaping the benefits requires some forethought and of bit careful design. I use an example modeling a network connection to illustrate this idea.
Swift 4 adds the ability to easily archive struct and enum types that implement the
Codable protocol, but default support for enums is limited to those with prepopulated default values (raw values). Conforming an enum with associated values to the
Codable protocol involves extra work, and it is the purpose of this article to show how this could be done.
I present a small, zero-dependency extension that computes the md5 hash function and does nothing else.
In this post, I’m going to create superficially real-looking text using a Markoff chain. I'll do it in Swift, and explain in particular various ways of using
IteratorProtocol to solve the problem.
I create an extension on
UIStoryboard to easily access Main.storyboard and instantiate custom
UIViewController subclasses by type without littering the codebase with hardcoded strings.
A discussion on how to implement drag-and-drop functionality on an
NSView without having to hook into AppKit's drag-and-drop API.