SwiftUI or UIKit for new projects ?

Harshit Parakh
2 min readSep 16, 2020

--

It’s been a decent time since Apple announced SwiftUI at WWDC19. Being an iOS Engineer and passionate technology enthusiast, we all have one common question while starting a new iOS project. Should we go for UIKit or SwiftUI ?
If you also have this question then you are at the right place.

I would not go through What is UIKit and SwiftUI. Instead i would share my experiences of Why SwiftUI and not UIKit.

Why SwiftUI ?

Better Apps Less Code

SwiftUI is an exceptionally remarkable simple declarative framework to build apps across all Apple platforms. Developers across the globe can write code for iOS, watchOS, macOS and tvOS with single code base.
With SwiftUI 2 introduced in WWDC20 and frameworks like Combine it is a no brainer to straight away jump into it and get your hands on to it.

SwiftUI + Combine + MVVM = ❤️

Advantages of using SwiftUI ?

  • No more Storyboard conflicts !! 😁
  • Live Previews and better performance.
  • UIKit elements compatibility using View Representable and UIHostingController.
  • Multiple platform support.
  • Easy to learn and far more easy to use.
  • Clean code and better readability.

Although SwiftUI is relatively new and we as developers might face some challenges / inconveniences while development. But with such a huge community and tech freaks out there any problem can be solved. 😉

Limitations / Minimum requirement of SwiftUI ?

  • SwiftUI works only on iOS 13 and above.
  • SwiftUI requires Xcode 11 and above.
  • Development tools are available only on macOS 15 and above.
  • Yes using UIKit every problem that you face might have possibly been solved by others. On the contrary as SwiftUI is relatively new you might be the first person to face that problem and come up with a solution. Ain’t that interesting ?

Using SwiftUI development is easy, sometimes debugging takes time.

Why not UIKit ?

  • Save time for migration as SwiftUI is going to be the future of application development on all Apple platforms.
  • Build apps faster and cleaner as there is no Auto layout. No more storyboards, no more XIB’s and most importantly no more constraints.
  • Developers do not have learn WatchKit, TVML and other AppKits separately.

Conclusion

We all have been using UIKit for a long now and Good Byes are hard to say. But with the fast changing technologies and frameworks we must always be eager to learn new things and start implementing. It is never to late to start.

More articles are coming soon to make you fall in love with SwiftUI.

Please feel free to share your views and any suggestions / feedbacks are welcomed.

Thanks for reading.

--

--

No responses yet