Does SwiftUI View Not Compile? Time To Start Making It Lighter

It’s necessary to be resourceful in unexpected situations when programming.

Gabriel Theodoropoulos

--

Photo by Kelly L: https://www.pexels.com/photo/cargo-ship-unloading-colorful-containers-in-port-6595779/

Well, this post is about a specific issue that I recently met in SwiftUI and I would like to share here. Comparing to UIKit, SwiftUI is still an infant, yet it’s not that new so we still have many dark points about it. Regardless, only by using it under various scenarios one can really see its ins and outs, and discover weaknesses that add friction to the development process.

Such a friction came to slow down my work significantly into an app just a few days ago, where a SwiftUI view could not be compiled, and as Xcode said, “in reasonable time”. Issues like that turn me towards the opinion of those people saying that most probably SwiftUI is not production-ready yet; a statement that I mostly disagree in general. Admittedly, chances are that SwiftUI won’t do everything we want out of the box, but with a few tweaks based mostly on UIKit (or AppKit on macOS) we can make everything work just fine. Despite any problems, I personally vote for SwiftUI and I’ll keep using it, having UIKit and AppKit as my assistants to my ongoing and future programming tasks (bold statement, but I don’t see myself going back to using pure UIKit or AppKit again).

--

--

Gabriel Theodoropoulos

An iOS & macOS app maker writing code in Swift. Author of countless programming tutorials. Content creator. https://serialcoder.dev