How I replaced a nested for loop with flatMap

04 November 2020

This is a short post about how I refactored a nested for loop using flatMap. I had a struct that defined name and quantity properties as shown below:

struct Item {
  let name: String
  let quantity: Int

The actual code used a custom type rather than a String, but I’ve used String here to simplify the example.


SwiftUI: Previewing localized text in the canvas

29 June 2020

Last week I watched the Swift packages: Resources and localization video from WWDC20. One thing I learned was that the Canvas can preview localized values. This is done by adding a locale to a View via the environment.


How I debugged a crashing watchOS app with crash reports and log files

08 May 2020

In a previous blog post, I wrote about my app crashing when it was installed via TestFlight. In this blog post, I will go into more detail about how I debugged the problem using logs and crash reports.


Rejection, Acceptance, And Crashes. My TestFlight Journey

03 May 2020

I hit a small milestone recently, I submitted my first app to TestFlight. I thought this process would be quick. Maybe a day or two. A week later I finally had a working app on TestFlight. During that time I learned much about crash logs and debugging. Here is my story.


Specify XCode version for GitHub workflows

16 April 2020

I wrote a unit test that used the XCTUnwrap function. This feature was added in XCode 11 and

“Asserts that an expression is not nil and returns the unwrapped value.”

However, when I pushed my code to GitHub, the build broke with the following error.

error: use of unresolved identifier ‘XCTUnwrap’


iOS Constraint Issues

05 August 2019

This post is about a problem I had with a UISearchController in an iOS app. The issue was the search bar would animate on top of the status bar. This made it hard to use as shown in the following video.


My iOS app journey

14 July 2019

It’s been awhile since I blogged, so I thought I should provid an update.

In the autumn of 2018 I started developing as iOS app as a hobby. Previously, I worked through the “iOS Development with Swift” book. The book leads you through the process of building an app. By the end of the book you have created a multi-screen functional app which lets you enter and sort books. I enjoyed the process and wanted to build my own.


Problem Solving Checklist

09 August 2018

I was recently working on a problem from a tutorial. The problem was basic: write some code that will build a Google search URL. It had the following requirements:

  • take a string to use for the search term
  • specify the google domain to search
  • use the ‘num’ parameter to limit the number of search results
  • use the ‘as_qdr’ parameter to limit the date range

The reason for implicitly unwrapped optionals

29 January 2018

In a previous post, I wrote about implicitly unwrapped optionals. However, I was not happy with the example I created; it felt contrived. The following is the example I used:


Thoughts on receiving my first pull request

13 December 2017

Last week I received my first pull request to a project on GitHub. This post is about my thoughts on the experience.