Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI vs Interface Builder and storyboards [closed]

Tags:

ios

swift

swiftui

I am new iOS development, I used storyboard and Interface builder to design my application UI. But now I am seeing that many people are using SwiftUI. I searched about SwiftUI and found some points about it as SwiftUI works seamlessly with new Xcode design tools to keep our code and design perfectly in sync. But I am not able to compare it with Interface builder & Storyboard. What are the advantages & disadvantages of SwiftUI over Interface Builder and storyboards? Is SwiftUI will completely remove Interface Builder and storyboards?

like image 746
MADHAVI KUMARI Avatar asked Jan 16 '20 09:01

MADHAVI KUMARI


People also ask

Is it better to use SwiftUI or storyboard?

Storyboard Advantages over SwiftUI It is easier to use Storyboard as a beginner . Storyboard consist of Xib and custom View which can be reusable in the projects. It is easier to build an app as there is only drag and drop of the elements of the storyboard.

Will SwiftUI replace storyboard?

There is no direct way of migrating from storyboard to swift UI. This compels a developer to continue the use of the storyboard for existing apps and in lower versions. Since, it is very new so there is less community support which is not the case for storyboard.

Can you use Storyboards with SwiftUI?

The answer is YES! Here we will be discussing a simple way to use SwiftUI into our existing project, which already consists of a storyboard.

Are Storyboards still used?

The short answer is yes. A shot list is a checklist of the coverage you need of a scene (a medium, a close-up, etc) and it's a good place to start, but that's all it is, a list. It's something your Assistant Director uses to create a schedule and it helps them keep track of the footage throughout the day.


1 Answers

In the interface builder like storyboard and xib you can see what you are doing. You take a component and then add it to the storyboard and that's how you design the UI, but if you do the same thing programmatically then it gets a lot harder as you can not see anything and you have to be experienced to do so. Every time you have to build an app to see the changes in the UI but SwiftUI solves this issue as it gets updated constantly as you write code. To solve this, Apple came up with SwiftUI which helps you to see what is going side by side. Anyone can move from Storyboard to SwiftUI.

Personally, I have started from Storyboard then moved to XIB and then I went to Flutter which was quite different and SwiftUI is quite inspired by Flutter. You have to keep in mind that SwiftUI support starts from iOS 13. You have to start from storyboard and then when you have gained experience then you can move to SwiftUI.

Update: Also, there is an another way of developing UI's and that is via programmatic UI coding. I have been developing UI's programatically for a long time now and personally it helps to understand the concepts of UI more and you can start adding a lot of extensions which will make your project easy to maintain at a later stage. When you develop in a group then interface builders throw merge conflicts a lot of time which becomes a pain very soon. (30 Oct, 2020)

like image 147
Rob Avatar answered Oct 26 '22 14:10

Rob