Command line calculator in Swift 4.2
Jan 8, 2019, 10:55 PM
I just published a command line calculator written in Swift 4.2 with a big README explaining how it all works. What a fun challenge! Enjoy… https://github.com/ijoshsmith/command-line-calculator
Simple deep linking in Swift
May 24, 2017, 10:11 PM
If you need to support deep links with a custom URL scheme in your iOS or tvOS app, check out my tidy little API to help convert URLs into deep link objects. It’s written in Swift 3. I published it on … Continue reading →
Reflectable enums in Swift 3
Apr 9, 2017, 2:31 AM
Suppose you are working on a Swift program that needs a data model to represent a contact, such as a person from the user’s address book or a FaceBook friend. You might start off by modeling this as a Contact … Continue reading...
Generate Equatable code in Swift
Jan 31, 2017, 8:25 PM
Here is my Swift 3 utility function for turning a live class/struct instance into Equatable protocol code for that type: https://github.com/ijoshsmith/equatable-code-generator Here’s to never writing that kind of code ever again!
Function composition in Swift
Jan 21, 2017, 4:14 AM
The way that functional programming languages allow functions to be combined can help make code easier to read and understand. The technique is known as function composition. I show how to compose functions in Swift 3 using custom...
json2swift: a peek under the hood
Nov 10, 2016, 6:03 PM
This article presents a high-level overview of how my json2swift tool works. Several people have expressed interest in using my code as the foundation for a similar tool, or just want to change the Swift code it generates, and have asked...
Swift JSON library vs. code generation
Nov 3, 2016, 6:16 PM
Ever since Swift was first released there has been an endless stream of new libraries to simplify writing Swift code that consumes JSON data. Since this is such a common and tedious aspect of developing apps, it’s an important topic...
Create Swift data models from JSON
Oct 30, 2016, 7:23 PM
I published a tool that analyzes JSON data and generates Swift data model code, named json2swift. This tool helps eliminate most of the error-prone grunt work involved with consuming JSON data in a Swift app. The repository’s README...
Concealment design pattern in Swift
Jul 19, 2016, 1:34 AM
This article introduces a design pattern that I call Concealment, and demonstrates how to use the pattern in Swift code. Purpose The Concealment pattern enables types to support novel, related functionality without adding nonessential...
Analyzing a dependency graph in Swift
Jun 8, 2016, 8:13 PM
I published my solution to Dave Thomas’s Transitive Dependencies programming exercise, known as a kata, to GitHub: https://github.com/ijoshsmith/transitive-dependencies-kata The Challenge This exercise involves analyzing a graph data...