
Member-only story
UI DEVELOPMENT
Using UIKit & SwiftUI Together
How to implement an App using both UIKit and Swift UI
In 2019 Apple presented SwiftUI, a new UI framework to develop our apps in a declarative way. Before that, all the iOS apps have to use UIKit to implement their UI.
SwiftUI promises incredibly advantages while developing:
- It is fully declarative, reducing the number of bugs in the code.
- It arranges the views automatically on the screen, saving us the time used to write layout code.
- It offers a preview panel in Xcode to show the UI while you write it, making prototyping faster.
Therefore, the overall goal to achieve is to reduce the development time required to build an App.
However, as often happens with recently released frameworks, SwiftUI was not good enough for a production app. It wasn’t efficient, especially with lists and grids; it wasn’t stable, having random crashes here and there; and it was supported only by iOS 13, so many users would have been cut out from our apps if we choose to use that framework.
A year has passed and SwiftUI has progressed a lot. They implemented lazy
containers to speed up the performances, the technology is more stable and more mature, and…