-
Swift
-
Zip 3
An implementation of a freezip
function that will take threeSequence
types and return anotherSequence
whose elements are each three-item tuples built from the elements of three underlying sequences. It's thezip
from the standard library but for three sequences. -
Good Types Reduce Bugs
The advantages of working in a type-safe language extend beyond the compiler complaining that it received anDouble
but expected anInt
. 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. -
Encoding and Decoding Enums with Associated Values in Swift 4
Swift 4 adds the ability to easily archive struct and enum types that implement theCodable
protocol, but default support for enums is limited to those with prepopulated default values (raw values). Conforming an enum with associated values to theCodable
protocol involves extra work, and it is the purpose of this article to show how this could be done. -
An Implementation of the MD5 Hash Algorithm
I present a small, zero-dependency extension that computes the md5 hash function and does nothing else. -
Fun with Sequence Protocols
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 usingSequence
andIteratorProtocol
to solve the problem. -
Easy UI Storyboard Extensions
I create an extension onUIStoryboard
to easily access Main.storyboard and instantiate customUIViewController
subclasses by type without littering the codebase with hardcoded strings. -
A Simple Drag-and-Drop NSView in Swift
A discussion on how to implement drag-and-drop functionality on anNSView
without having to hook into AppKit's drag-and-drop API.
-
-
AppKit
-
A Simple Drag-and-Drop NSView in Swift
A discussion on how to implement drag-and-drop functionality on anNSView
without having to hook into AppKit's drag-and-drop API.
-
-
UIStoryboard
-
Easy UI Storyboard Extensions
I create an extension onUIStoryboard
to easily access Main.storyboard and instantiate customUIViewController
subclasses by type without littering the codebase with hardcoded strings.
-
-
Markoff Chains
-
Fun with Sequence Protocols
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 usingSequence
andIteratorProtocol
to solve the problem.
-
-
Sequence protocol
-
Fun with Sequence Protocols
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 usingSequence
andIteratorProtocol
to solve the problem.
-
-
md5
-
An Implementation of the MD5 Hash Algorithm
I present a small, zero-dependency extension that computes the md5 hash function and does nothing else.
-
-
Codable
-
Encoding and Decoding Enums with Associated Values in Swift 4
Swift 4 adds the ability to easily archive struct and enum types that implement theCodable
protocol, but default support for enums is limited to those with prepopulated default values (raw values). Conforming an enum with associated values to theCodable
protocol involves extra work, and it is the purpose of this article to show how this could be done.
-
-
Type Safety
-
Good Types Reduce Bugs
The advantages of working in a type-safe language extend beyond the compiler complaining that it received anDouble
but expected anInt
. 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.
-
-
Xcode
-
How to update your Cocoapod
A checklist to help me (and possibly you) remember what to do to update a Cocoapod that you own.
-
-
Git
-
How to update your Cocoapod
A checklist to help me (and possibly you) remember what to do to update a Cocoapod that you own.
-
-
Cocoapods
-
How to update your Cocoapod
A checklist to help me (and possibly you) remember what to do to update a Cocoapod that you own.
-