Five things iOS developers should focus on in 2022Published on: January 3, 2022
A new year has started and most of us are probably figuring out what we should focus on this year. Whether it’s learning new things or expanding our knowledge on topics we’ve already learned about in the past, there’s always something that deserves our attention in the world of iOS development.
Free In-App Messaging SDK & UI Kits for iOS/Swift
Stream's Chat SDK helps you build beautiful chat applications with as little code as possible. With our SDKs, you can bring high-quality chat experiences to all of your end-users. SDKs are available for SwiftUI.
Try for free
This sponsored message helps keep the content on this site free. Please check out this sponsor as it directly supports me and this site.
In this short post I’ve listed five things that I believe will help you become a better developer in 2022. Or rather, the first half of 2022. I’m fully expecting Apple to release some cool new interesting things at this year’s WWDC that deserve some of your attention in the second half of the year.
That said, if you focus on the five things listed in this post I’m sure you’ll come out as a stronger developer by the end of the year.
Please not that this list should not be treated as the “definitive” guide to becoming a good developer in 2022. Nor is it a list of the most important topics for everybody that does iOS development.
It’s a list of topics that I believe to be important, and it’s a list of topics that will take up a lot of my time this year. If you disagree with this list, that’s absolutely okay; your priorities do not have to align with mine.
With that out of the way, let’s jump into the first topic on my list.
1. Using SwiftUI alongside UIKit (and vice versa)
One of the most polarising questions I’ve seen in 2021 is probably whether or not SwiftUI is “production ready”. In my opinion that question is way too vague because the answer depends on what an individual’s definition of production ready is within their context. What’s more important in my opinion is the fact that SwiftUI can be used in your apps just fine. Whether you want to go all-in or not, that you’re choice. There are even cases where going all-in on SwiftUI isn’t quite possible for various reasons.
The vast majority of apps I’ve seen and worked on in the past year can get really far with just plain SwiftUI but almost always there are some edges where dropping down to UIKit was needed. Alternatively, I’ve seen existing production apps that wanted to start integrating SwiftUI without rewriting everything straight away which is completely reasonable.
Luckily, we can use SwiftUI and UIKit simultaneously in our projects and I would highly encourage folks to do this. Make sure you dig and understand how to mix SwiftUI into a UIKit app, or how you can fall back to UIKit in a SwiftUI app if you find that you’re running into limitations with purely using SwiftUI.
Knowing how to do this will allow you to adopt SwiftUI features where possible, and speed up your development process because writing UI with SwiftUI is so much faster than UIKit (when it suits your needs). On top of that, it will take a while for companies to have all their apps written exclusively in SwiftUI so knowing how to gradually introduce it is a really valuable skill to have as an employee or even as someone who’s looking for their next (or their first) job.
2. App Architecture
No, I don’t mean “learn VIPER” or “learn all the architectures”. In fact, I’m not saying you should learn any app architecture in particular.
In my opinion it’s far more valuable to understand the principles that virtually every architecture is built upon; separation of concerns. Knowing how and when to split your app’s functionality into different components, and knowing how these components should be structured is extremely important when you want to write code that’s easy to reason about, easy to refactor, and easy to test.
Try and learn about topics such as single responsibility principle, dependency injection, abstractions, protocols, generics, and more. Once you’ve learned about these topics, you’ll find a lot of the architectural patterns out there are just different applications of the same principles. In other words, lots of architectures provide a framework for you and your team to reason about different layers in your codebase rather that a completely unique way of working.
A less obvious reason to learn more about app architecture is that it will help you write code that can work in a SwiftUI world as well as a UIKit world which is extremely useful given what I explained in the first point on this list. The ability to architect a codebase that works with both SwiftUI and UIKit is extremely useful and will definitely help you enjoy the experience of mixing UI frameworks more.
Topics like structured concurrency, actors, task groups, and more are extremely useful to learn about this year. Especially because Apple’s managed to backport Swift Concurrency all the way to iOS 13. Make sure you’re using Xcode 13.2 or newer if you want to use Swift Concurrency in apps that target iOS 13.0 and up, and you should be good to go.
If you want to learn more about Swift Concurrency, I have a couple posts available on my blog already. Click here to go to the Swift Concurrency category.
4. Core Data
Yes. It’s a pretty old framework and its Objective-C roots are not very well hidden. Regardless, Apple’s clearly still interested in having people use and adopt Core Data given the fact that they’ve added new features for Core Data + SwiftUI in iOS 15, and previous iOS versions received various Core Data updates too.
Will Apple replace Core Data with a more Swift-friendly alternative soon? I honestly don’t know. I don’t think it’s likely that Apple will do a complete replacement any time soon. It seems more likely for Apple to keep Core Data’s core bits and provide us a more Swift-friendly API on top of this. That way the transition from the current API to a newer API can be done step by step, and our apps won’t have to go through some major migration if we want to leverage the latest and greatest. Pretty similar to how Apple is introducing SwiftUI.
Is Core Data the absolute best way to persist data in all cases? Probably not. Is it extremely difficult to implement and way too heavy for most apps? No, not at all. Core Data really isn’t that scary, and it integrates with SwiftUI really nicely. Check out this video I did on using Core Data in a SwiftUI application for example.
If you want to learn more about Core Data this year, I highly recommend you pick up my Practical Core Data book. It teaches you everything you need to know to make use of Core Data effectively in both SwiftUI and UIKit applications.
Last but by no means least on my list is a topic that I myself should learn more about. Accessibility is often considered optional, a “feature”, or something you do last in your development process. Or honestly, it’s not even rare for accessibility to not be considered on a roadmap at all.
When you think of accessibility like that, there’s a good chance your app isn’t accessible at all because you never ended up doing the work. I’m not entirely sure where I’ve heard this first but if you’re not sure whether your app is accessible or not, it isn’t.
Accessibility is something we should actively keep an eye on to make sure everybody can use our apps. Apple’s tools for implementing and testing accessibility are really good, and I have to admit I know far too little about them. So for 2022, accessibility is absolutely on my list of things to focus on.