Having mentioned Button publicly, I’m now committed to actually putting it out there.
My original plan was to go web first, or web only, but when iOS 14 came out I was taken by the new widgets — ”I want my deployment status on my home screen” — so I installed the Big Sur beta, the latest Xcode, and off we go.
There’s been much talk recently of the bad state of Apple’s developer documentation. How’s that?
In a previous life I spent a good few years crafting iOS apps. It’s how I got into open source, helping on DRF, which I was using to build backends APIs for mobile clients.
Back in my day there were good per-topic Programming Guides that explained (essentially) everything. Yes, there was a lot to learn, but there was a clear pathway from a start point to an understanding of how the many frameworks and APIs fit together.
Now? I have to say that’s missing. It goes straight from the start point to somewhat sparse API guides. The per-topic programming guides are missing, or archived, or….
I’m focusing on Apple’s new SwiftUI framework, which is a world removed from what I knew before. Under the hood it’s mapping back to UIKit, so I’m spending a lot of time thinking, What would I do in UIKit?, and then searching for a SwiftUI version of that. We’re a couple of years in at this stage, so there are plenty of search results, but if I put myself in the position of a beginner I’m not sure at all whether it would come that easily.
There are good community resources. Here are the sites that I’ve found the most handy for SwiftUI content:
Plenty of content there.
Hacking with Swift has a mountain of free content, plus books and videos and what-not. If I were trying to learn this fresh, I would be tempted to take up the membership there — it’s something like $20/month for everything, which seems good to me.
The thing I did buy was a SwiftUI Companion app from The SwiftUI Lab. This is an app with much better API-level documentation for SwiftUI. Interactive examples and all-sorts. Very helpful. It’s still not the high-level guides that I think are missing — you have to read around the web for those — but it makes a massive difference when trying to work out which API I should be using (and how). Recommended.
In contrast, as well, to be fair, there are still some awesome Apple docs out there. JSONDecoder
has a sample playground on using JSON with custom types which is everything you could hope, and there are lots like that. With the massive work that must be going on to produce SwiftUI, and the various platform changes Apple are pushing forward, I can only presume that the docs will improve in depth as the frameworks mature. Not sure that makes it any easier if you’re looking to begin now.
I have to say super. SwiftUI is lovely. It is succinct, and so quick, and oh so much less work than UIKit to put views in place.
Is it perfect? No. It’s still young. There're bits where it doesn’t look like you can do what you want to. And the odd bug. But you can shell out to UIKit when you want (it’s not shelling out, but that’s how I think of it). And, not a small thing, a build setting change, and your app is running on the Mac.
This last isn’t perfect, and it isn’t free in terms of effort, but starting a new app, which is beginning small, and will evolve no faster than the framework support, even on the most optimistic timeline, there’s no question that focusing on SwiftUI is the right way to go here for me.
Swift itself is a fun language. There’s a bit of a mental leap into reading tailing closures as what they are, and various of the syntactic wiggles around the type system are curious at first. Nonetheless, a while in, these disappear with familiarity and you’ve got a modern language, with seamless C integration, that has all the benefits of genuine static typing.
I will say though, after a long session, it is nice to get back to Python, where you don’t need all that and can just write code. (Though, of course, these days you can add an amount of something like it if you want to).