iOS Posts

Expanding my new app experiment

Four months ago I wrote about a Taylor Swift trivia app I’d made as an experiment. The idea was to spend a small amount of time building a quiz app and seeing how it performs. At the time, I wrote “If it does well, it’ll be very easy for me adapt it to make more trivia apps about other topics (e.g. a football quiz, movies quiz, and so on).”

Read more »
Experimenting with a new app

In my quest for more revenue from my app business, I’ve made a new app: a Taylor Swift quiz.

Read more »
My wishlist for Apple's developer tools

I started building for Apple platforms in 2020 when SwiftUI was on the bleeding edge and lacked a lot of features. Since then it’s been great seeing it improve every year to be able to do more and more.

Read more »
Introducing SalaryPig

In my 2023 in review I set myself a goal to release two new apps this year. Here’s the first one.

Read more »
The third-party libraries I use in every project

In my day job I’m currently a front-end web developer working with JavaScript, React, Webpack, and so on.

Read more »
2023 in review

Since I became an indie developer in 2020 I’ve written an end of year review each year about how my apps performed. Here’s 2023’s edition.

Read more »
Building a custom date formatter for Swift

My workout insights app Personal Best includes a lot of date formatting for displaying workouts and leaderboards, which was a little unwieldy when initially written. iOS 15 brought a new Formatter API to Swift that makes it simpler to format data, and I’ve now migrated over to it (two years after launch 😅). Here’s how to take advantage of it and make a custom formatter.

Read more »
Hockeysticking

At the end of last year I set myself a goal of doubling Personal Best’s recurring revenue. At the time I felt like this struck a good balance between challenging while still realistically achievable.

Read more »
Going full-time indie (for now)

Since I graduated university in 2011 I’ve always had a full-time job, working at a few different companies, and the longest I’ve ever had between roles was a five week gap between ending one job and starting another in 2017.

Read more »
Resources for indie iOS developers

I’ve been an independent iOS app developer since April 2020, when I launched Personal Best, my workout insights app. Since then I’ve added Taylor’s Version, and I’m currently working on a third app.

Read more »
2022 in review

For the last two years I’ve written something about how my apps developed and performed throughout the year, along with my goals for the next year (see 2021 and 2020).

Read more »
Keeping a widget up to date efficiently on iOS

My workout tracking app Personal Best includes widgets for tracking your workouts from your home and lock screens using WidgetKit.

Read more »
Introducing Taylor's Version

My friends know that I’m not only a fan of the Swift programming language, I’m also a huge fan of Taylor Swift. Seriously, check out my Spotify Wrapped from 2021:

Read more »
A better way to create images from SwiftUI views

In late 2020 I wrote a guide about turning SwiftUI views into images. This solution worked but it came with some limitations:

Read more »
2021 in review

This time last year I wrote a post about how I made my workout-tracking app Personal Best and my goals for the coming year. Now we’re approaching the end of 2021, here’s a reflection on how things have gone.

Read more »
Sharing to Instagram Stories in SwiftUI

Recently I added the ability to share directly with Instagram Stories to my workout-tracking app Personal Best. Here’s how to do it. This tutorial is tailored to SwiftUI, but the code is generic enough that it could easily be applied to a UIKit app.

Read more »
Adding privacy-first analytics to Personal Best

Intro

Read more »
Adding polylines to maps in SwiftUI

As of March 2021, SwiftUI has a built-in map view but it’s quite simple, only supporting basic annotations.

Read more »
Adding haptic feedback to buttons in SwiftUI

Haptic feedback is a huge part of iOS and many apps use it well to add subtle feedback to certain actions.

Read more »
Accessing the photo library in SwiftUI

SwiftUI doesn’t yet have an easy way to access the camera or photo library. hackingwithswift.com already has a great tutorial on how to access the camera from SwiftUI.

Read more »
Using DispatchGroup in Swift for asynchronous loops

Occasionally in an iOS app you’ll do something asynchronous, calling a completion handler when it’s done, like this:

Read more »
Making your own errors in Swift

Swift’s Error protocol is commonly used across Apple’s APIs to represent failure states.

Read more »
Going indie: 2020 in review

Note: This post has embedded tweets which may set cookies. The rest of this website doesn’t use cookies at all.

Read more »
Creating images from SwiftUI views

Update: I now have a much-better way to do this and this post should be considered deprecated. See a better way to create images from SwiftUI views for the new-and-improved solution.

Read more »
Static maps in SwiftUI with MKMapSnapshotter

Since iOS 14, SwiftUI has included components for adding maps to your apps.

Read more »
Optional view arguments in SwiftUI

I came to SwiftUI from the React world, where it’s common to pass views (components in React terminology) to other views:

Read more »
Declaring unnamed arguments in SwiftUI

Swift has long had the ability to omit argument labels to aid readability:

Read more »
Adventures in SwiftUI 2's MapKit support

SwiftUI 2 comes with a Map component, for displaying views from Apple Maps in your apps.

Read more »
iOS 14's bizarre text casing behaviour in List headings

Here’s a SwiftUI list with a section header:

Read more »
Multiline text in SwiftUI

I keep running into an issue in SwiftUI where some text truncates where I don’t expect it to. Here’s an example from Personal Best’s onboarding screen:

Read more »
Building a more generic page control in SwiftUI

Note: This article was written for iOS 13. iOS 14 has support for page controls built in. There is also now iPages, a great third-party library you can use for this.

Read more »
SwiftUI view modifers and dark mode

In SwiftUI, you can achieve most UI needs without ever explicitly checking for dark mode, thanks to semantic colours built into the platform and the ability to define our own semantic colours that automatically adapt to dark mode.

Read more »
Earliest sample dates in HealthKit

When building a watchOS extension for my iPhone app Personal Best, I couldn’t figure out why querying the HealthKit store for workouts was only returning 25 results, as opposed to over 700 on iPhone.

Read more »
Running HealthKit queries in the background

Recently I’ve been trying to use HKObserver to monitor queries from HealthKit in the background. I wrote a simple integration where my app would print to the console every time a new workout was recorded. However, it was never triggered, except when I opened my app in the foreground.

Read more »
Making SwiftUI navigation bar buttons bigger

Apple’s human interface guidelines specify that tap targets should be at least 44x44pt to ensure they’re easily tappable.

Read more »
SwiftUI sheets and environment objects

@EnvironmentObject is handy for passing data between views in SwiftUI. Hacking With Swift has an excellent guide on how to use it, but when I followed it, one some of my views it just wasn’t working correctly.

Read more »