proxpero Projects Archive About

  • Zip 3

    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.
  • How to update your Cocoapod

    A checklist to help me (and possibly you) remember what to do to update a Cocoapod that you own.
  • Good Types Reduce Bugs

    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.
  • Encoding and Decoding Enums with Associated Values in Swift 4

    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.
  • 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 using Sequence and IteratorProtocol to solve the problem.
  • Easy UI Storyboard Extensions

    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 Simple Drag-and-Drop NSView in Swift

    A discussion on how to implement drag-and-drop functionality on an NSView without having to hook into AppKit's drag-and-drop API.