Yet another blog precipitated by a Stack Overflow post that niggled away at me. Decoding heterogenous JSON was something that I'd done in the past, but as always seems to be the case with complex JSON decoding, it took me a while to get my thinking clear and come up with a solution. This post details how to wrap the ambiguity of heterogenous data inside an enum with associated types for type-safe decoding with Swift and Codable.
How, with XCode 11 & iOS13, to control which Storyboard view controller is used as the app's initial view controller.
Extend UIColor to enable the easy generation of single colour images, and then use these to create buttons with background colours that change according to state.
Apple's reverse geocoding service doesn't behave as advertised. It accepts multiple requests, responds to the first, but then, contrary to the documentation, ignores the subsequent ones. It doesn't even return an error code. Why, and is there a workaround?
It's easy to move back to the previous view controller in the navigation controller's stack. Moving back more than one is trickier. Doing it elegantly even more so. This post covers how I finally came up with an elegant, generic solution to this problem.
A source of common iOS bugs (believe me, I know!) is that a view controllers .viewWillAppear can’t always be relied upon to update an app’s UI. When an app is returned from the background this method isn’t invoked as in… Read More »viewWillAppear() doesn’t fire when returning from the background
Gradient fills can add a life to any UI when used tastefully, and they are exceptionally easy to implement. Here we will fill a view with a simple gradient fill, and then change it to apply the gradient to just the view's text.