Simplifying Backwards Compatibility in Swift
Oct 8, 2021, 8:00 PM
Every year as new OS and Swift versions are released, the question comes up over and over again: “how do I use this new thing while also supporting older versions?”. While we have a bunch of “availability” tools at our disposal (and I’ll...
Core Data and SwiftUI
Apr 2, 2021, 8:00 PM
In the previous post, I shared how you can create custom property wrappers that will work with SwiftUI’s view updating mechanism. I wrote that because I’ve got one other neat property wrapper to share, but understanding how it works...
Custom Property Wrappers for SwiftUI
Apr 1, 2021, 8:00 PM
As I’ve been working with SwiftUI, I’ve come up with some custom property wrappers that I want to share with you. Most of these are property wrappers that can be easily accomplished using other approaches, but I like these for their...
Exploiting String Interpolation For Fun And For Profit
Mar 3, 2021, 7:00 PM
A while ago I was playing around with Swift’s string interpolation functionality and come up with something cool I thought I’d share with you.
HTTP in Swift, Part 18: Wrapping Up
Oct 2, 2020, 8:00 PM
Over the course of this series, we’ve started with a simple idea and taken it to some pretty fascinating places. The idea we started with is that a network layer can be abstracted out to the idea of “I send this request, and eventually I...
HTTP in Swift, Part 17: Brain Dump
Oct 2, 2020, 8:00 PM
I was planning on having a few more posts on different loaders you can build using this architecture, but for the sake of “finishing” this series up, I’ve decided to forego a post-per-loader and instead highlight the main points of a few...
HTTP in Swift, Part 16: Composite Loaders
Aug 4, 2020, 8:00 PM
So far we’ve built two different loaders that handle authentication, and it’s conceivable we’d want to build more to support others. Wouldn’t it be nice if we could encapsulate all of the “authentication” logic into a single loader?
HTTP in Swift, Part 15: OAuth
Aug 2, 2020, 8:00 PM
The last post covered the basics of an OAuth flow: how we check to see if tokens, how we ask the user to log in, how we refresh the tokens, and so on. In this post we’re going to take that state machine and integrate it into an HTTPLoader...
HTTP in Swift, Part 14: OAuth Setup
Jul 27, 2020, 8:00 PM
While Basic Access authentication works for “basic” cases, it is far more common these days to see some form of OAuth used instead. There are some interesting advantages that OAuth has over Basic authentication, such as:
HTTP in Swift, Part 13: Basic Authentication
Jul 26, 2020, 8:00 PM
HTTP requests to web apis frequently need to have some sort of credential to go with them. The simplest kind of authentication is Basic Access authentication, and in this post we’ll be adding this feature to our library.
HTTP in Swift, Part 12: Retrying
Jul 22, 2020, 8:00 PM
Most networking libraries have the ability to automatically send a request again if the received response wasn’t quite what the client was looking for. Let’s add that to our library as well.
HTTP in Swift, Part 11: Throttling
Jul 19, 2020, 8:00 PM
I once worked on an app that used a Timer to periodically ping a server with a status update. In one build of the app, we noticed that the status server started experiencing CPU spikes, eventually culminating in it not being able to handle...
HTTP in Swift, Part 10: Cancellation
Jul 18, 2020, 8:00 PM
Cancelling an in-progress request is an important feature of any networking library, and it’s something we’ll want to support in this framework as well.
HTTP in Swift, Part 9: Resetting
Jul 11, 2020, 8:00 PM
There are a couple remaining changes we need to make to our loading interface, and one of them is to allow resetting.
HTTP in Swift, Part 8: Request Options
Jul 8, 2020, 8:00 PM
So far we’ve written enough code to describe a chain of HTTPLoader instances that can process an incoming HTTPRequest and eventually produce an HTTPResult.
HTTP in Swift, Part 7: Dynamically Modifying Requests
Jul 4, 2020, 8:00 PM
In this post, we’ll be creating an HTTPLoader subclass that will allow us to dynamically modify requests.