Want to move to mobile software development? Great! Decided on the Apple ecosystem? Great! The old guard say that UIKit is the important foundation, and SwiftUI is not production ready. Tutorial factories are focussing on SwiftUI. So the question remains: What should you learn? This isn't an article that is going to tell you what to do. Only you can make that decision, but in order to make a good decision you should think about the advantages and disadvantages of each.
UIKit has a long history at the heart of Apple's mobile development ecosystem.
- Loads of guides and tutorials around, and question-asking websites are full of questions around UIKit
- Can be used interoperably with SwiftUI
- Used for many popular Apps on the App Store
- Seems to not be the future
- Some find parts of UIKit to be tricky, or less intuitive than they might like UIKit is unlikely to die. There are so many applications working with UIKit, and the interoperability between UIKit and SwiftUI means that it is likely that hybrid Apps will be around… well. For a while. In a world where Google ask for Objective-C experience for their iOS Software Engineer positions you begin to see the power or companies wanting the technology that their staff feel comfortable with, rather than what is currently in vogue.
- Easy to learn, and people seem to like it
- Interoperability with UIKit
- Themes are easily managed for dark and light mode
- Combine is a great tool for reactive programming
- Live preview allows changes to be seen quickly in a controlled UI environment
- Users need to be running iOS13, and for some companies this cuts off many of their user-base
- There can be a lack of resources, barring the usual tutorial factories
- Some developers have complained about unclear architectures and hacks in order to be able to do things that were previously possible without fuss using UIKit
- Some do find the syntax for SwiftUI to be tricky
- Many coding challenges still do not allow you to complete them using SwiftUI
- Many companies still use UIKit Some people complain about the difficulty of remembering to connect outlets in UIKit and Autolayout, and SwiftUI sidesteps these issues for those people. Yet it isn't all easy wins, we are missing the view hierarchy from Xcode Previews.
In truth the gap between UIKit and SwiftUI is closing, and we are already seeing Apple moving many WWDC talks towards SwiftUI, and way back in 2019 it wasn't possible to write a whole App using SwiftUI and now (thankfully) it is. Not only that, but you can write a SwiftUI cross-platform App entirely in SwiftUI! It does seem like SwiftUI is the future! The considered conclusion The leading course by Paul Hegarty at Stanford CS193P has now adopted SwiftUI, and THAT is the single best course available (and is completely free). I do appreciate that course does require a certain amount of skill and knowledge around computer science concepts, and developers may need to study one of the other Stanford courses before it is accessible. I think that is one of the reasons that when I started studying Swift, I approached it with this strategy:
- Created my own fun little project at the earliest opportunity
- Studied the Language, Swift, ahead of any framework By creating my own project I felt motivated. Studying the language has given me real underpinnings that work no matter the fashionable framework or architecture that people use at any given time. Now I know you might be tempted by "learn to code in 30 days" or "many days of tutorials", but the truth? This is a many year project. I'm sorry about that, but to be the best really does take work and energy.
There are no right and wrong paths to your life. You are accountable for your own decisions, and the point is rather better focussed on what you want to achieve, and how you might do that.