SwiftUI from a UIKit Fanboy

ShreeThaanu Raveendran
3 min readMay 25, 2023

--

Was it me or you too felt that the SwiftUI is revolutionary and end up drained by learning at the first place. Gave a try and didn’t worked out and ended up in building same app in UIKit.

Okay first things first, I love SwiftUI for solving major UI stuffs like (Animation, geometry and custom components) in a one liner, and hate it for making small UI Changes (like positioning views) into a nightmare. For someone like me who indulged in UIKit for more than half a decade its kind of different.

Where am i finding SwiftUI interesting >

I generally work in E-Commerce applications, so i’m in a stage to adapt to the advancement for better UX and lightweight UI. I love the declarative way which is far more convenient in controlling the UI rather than providing too many procedural steps. Thats not it, SwiftUI is faster and more importantly less weight compared to UIKit. Unlike the UICoding, SwiftUI provides the live preview which is more useful while developing. The extensive API’s that Swiftui provides on top of UIKit are amazing and that makes the development faster.

Key takeaways from my SwiftUI Journey >

  • I can see swiftUI as a prototyping app or something that can be used in few modules/small scale applications without much complex UI.
  • They work really cool with animation. Few things like onboarding tutorial screens can adapt to swiftUI which will bring great effort in UX and the first impression you get from customer.
  • Widgets becoming popular these days so SwiftUI’s scope increases.
  • SwiftUI provides you cleaner abstractions in code where your data and the view hierarchy displaying your data are much more loosely coupled. This gives you more flexibility when reusing existing bits of model and view hierarchy logic in SwiftUI.
  • Its adaptability for UIKit when in need you can combine SwiftUI inside the UIKit but i have seen some edge cases where stuff goes out of hands.
  • Sometimes its hard to get the help needed for development, Though there are lots of tutorials available but when working in realtime projets there are few scopes that has to adjusted because of the lack of information and help.
  • SwiftUI is designed to be performant, so you can be confident that your apps will be responsive and smooth even on older devices. Personally i didn’t feel much because all i did was sample apps.

Fact check :

I believe SwiftUI to be much easier and faster to learn and use than UIKit, something you can get hands on and get up and running within an hour or so.

Sometimes SwiftUI just isn’t the best choice for a project and there are plenty of possible reasons for that (same with UIKit), be it legacy codebase, support for older iOS versions, robustness, extensive support, packages and APIs available, documentation, API maturity and volatility, flexibility, performance, reliability, testability or extensibility.

For instance, if your team built a whole Design System library around UIKit that uses complex component customisation, maybe switching right away to SwiftUI isn’t the best idea.

We all know SwiftUI is the future of native iOS UI development, this is not the subject of discussion here. But it is important to understand what we mean by “future”. Even if it is supposed to be a replacement, it is far from dominant, let alone the only choice right now.

I’d give 5–10 years for SwiftUI to be more predominant than UIKit, but that is totally speculative. Even so, SwiftUI being predominant. I think it is going to be much longer than that for us to not use UIKit at all (or almost nothing). Oh, and remember SwiftUI has already been around since 2019 (about 4 years old).

To be honest, as much as I like SwiftUI I have to admit it is extremely limited when compared to UIKit, at least for now. There’s plenty you just can’t do without going into a lower level API.

Follow me on other social networks too.

LinkedIn: https://www.linkedin.com/in/shreethaanu-raveendran-7a6275b2/

Github : https://github.com/shreethaanu

Instagram : https://www.instagram.com/shreethaanu_blogs/

Portfolio : https://strlabz.com

Patreon : https://www.patreon.com/shreethaanu

If you like my post and wanna see more support me ☕️

--

--

ShreeThaanu Raveendran

Apple Platforms Developer | XR Researcher | DesignTechnologist