Is 2023 the Time to Fully Switch to SwiftUI?
by Adrian Perțe, iOS Lead Engineer
Is 2023 the Time to Fully Switch to SwiftUI?
In 2023, technology is continuing to move at a rapid pace, and Apple's SwiftUI is no exception. Launched in 2019, SwiftUI presented a groundbreaking paradigm for iOS, macOS, watchOS, and tvOS app development, offering an intuitive, developer-friendly interface and promising to transform the way developers approach Apple platforms. Four years on, we must ask the question: Is 2023 the time to fully switch to SwiftUI?
Embracing Declarative Syntax
One of SwiftUI's most lauded features is its declarative syntax. Instead of instructing the program on how to display the UI, as was the case with the predecessor UIKit, developers now simply need to declare what the UI should look like. This development results in more readable and maintainable code, making it easier for developers to work with and modify their creations.
Live Preview and Hot Reload
SwiftUI's live preview and hot reload features are absolute game-changers. These features allow developers to see the results of code modifications in real time, without having to pause and restart the application. This drastically reduces development time and makes the process more efficient and seamless.
Less Code, More Functionality
The philosophy behind SwiftUI is to accomplish more with less code. With SwiftUI, the number of lines needed to create complex UIs has reduced significantly. This not only simplifies the development process but also enhances app performance, as less code generally leads to fewer bugs and smoother execution.
The Concerns
While SwiftUI has made impressive strides, there are still a few hurdles that developers need to consider. For one, SwiftUI is only compatible with iOS 13 and above. For apps targeting a broad demographic, including users with older devices, sticking to UIKit or using a combination of both may still be the most practical approach.
Further, while SwiftUI has improved significantly, it may still lack certain functionalities provided by UIKit. Developers might need to revert to UIKit for those specific cases, meaning they need to maintain proficiency in both.
Looking Ahead
In 2023, SwiftUI has matured a lot since its launch and is closer than ever to being a complete standalone framework for building Apple's platform apps. For new projects, especially those targeting iOS 13 and later, SwiftUI is becoming an increasingly compelling choice.
However, given the existing limitations, a total switch may not be feasible or desirable for all developers or all projects. Each team will have to evaluate the switch based on their project requirements, targeted audience, and long-term maintenance plans.
So, is 2023 the year to fully switch to SwiftUI? The answer will depend on your unique circumstances. However, one thing is certain: SwiftUI's rise is unstoppable, and it's definitely a tool worth considering for your app development toolbox.
Do we use SwiftUI?
The answer is absolutely. There are major benefits of using SwiftUI, especially in projects where time to market is crucial. We have used SwiftUI in several projects, and we are excited to see how it will evolve in the future.