UI DEVELOPMENT

Speed Up UIKit Development With Previews

Improve your UIKit game by leveraging SwiftUI previews.

Riccardo Cipolleschi
Nerd For Tech
Published in
5 min readJan 26, 2021

--

This weekend, I was playing a little bit with SwiftUI. I was designing a bunch of Views and I thought that the previews are great. I was able to iterate very fast on my views.

It would be amazing to port this feature to the UIKit world. Most of our apps are still based on UIKit they will stay like this for another while. SwiftUI is not yet completely customizable and flexible to achieve everything we need. There could be many benefits in porting this workflow into our daily activities.

The UIKit View

I prepared a very simple view for this article. The view leverages Kingfisher to load some assets from the Internet, but it is the only dependency. As usual, we will approach the View development by leveraging an MVVM approach and the SSUL pattern to Setup, Style, Update, and Layout our view.

The Model

Here is the view-model for our view:

--

--

Riccardo Cipolleschi
Nerd For Tech

Hey there, I’m Riccardo. Software engineer at Meta. I have a passion for iOS and I love to share my knowledge with others.