Should you use SwiftUI or the Interface Builder (Storyboard) for your next project?
An honest response to a highly debated topic...
An honest response:
The debate between the newly released SwiftUI and the Swift Interface Builder is never-ending, with each and every person with their own unique thoughts and opinions. I’ve come to settle this, by looking at the different properties of both SwiftUI and the Interface Builder.
Both are equally capable, but its all up to the developer and their specific needs. With that in mind, I will talk both about the advantages and disadvantages of SwiftUI and the Interface Builder (Storyboard).
Swift UI follows more of an interactive side to programming, with the environment being far more simple and easy to understand.
The drag and drop concept in SwiftUI makes it far easier for the user to understand how Swift works without getting intimidated.
Unfortunately, I found that SwiftUI can increase the chances of errors in the view since there are very big consequences for placing an element in the wrong place. Since SwiftUI isn’t that detailed, its, at times, hard to be sure if everything is perfectly correct and in-line, thus making the entire debugging process more time taking.
On the other hand, SwiftUI is absolutely perfect for beginners, with terms and methods of implementation being boiled down to a couple simple words. Since its quite new, there are very less tutorials and most likely, not many of your questions have already been asked on Stack Overflow.
Does this mean you should completely abandon SwiftUI? Hell no!
Just like Objective C, Swift was a language that people took time to migrate into. Now, nearly every iOS developer is using Swift for their projects. The Interface Builder has been in the eyes of the public for a long time, but Swift UI is coming up quite fast. It definitely won’t be much of a surprise that Swift UI turns out to be the next “big thing” everyone is jumping on after a couple of years. Better off to get a head start, right?
SWIFT INTERFACE BUILDER:
Similar to SwiftUI, the Interface Builder relies heavily on the concept of visualization and making concepts and the entire process of development easier of a developer.
Unlike SwiftUI, there are TONS of resources on the Swift Interface Builder from tutorials on YouTube to amazing and in-depth courses on Udemy. If you ever have a question about a bug or an issue you might be facing using the Interface Builder, there’s a 90% chance it’s already been asked in Stack Overflow, therefore making it easier for any developer to speed up their debugging process.
The detail and work put into the building of the Interface Builder is clearly imminent as soon as the user opens up a project using Storyboard. Its far easier to navigate to certain specific places in your project.
Unfortunately, this only applies to those who HAVE experience using Storyboard. Without prior experience, it can be a living hell to new programmers who have no experience with any platform similar to Xcode at all.
In addition, there definitely are a lot of technical problems with the Interface Builder. One of the most noticeable are merge conflicts, where a user might want to move their files or code to another project. This would pose numerous problems in terms of dependencies. Resolving such issues usually take hours, depending on how many files you moved and how large the project is.
If you’re building a big and complex app, the Interface Builder shouldn’t be your first choice. While the Interface Builder gives the user the ability to create segues between different views, a app with multiple pages and a complex design can make this entire flow quite hard to understand, which could lead to further problems.
For example, overlapping arrows or arrows hiding behind other View Controllers can make the entire process time consuming and making the code more prone to further errors.
— — — — — — — — — — — — — — — — — — — — — — —
With all this said, I would like to once again state that both platforms are absolutely amazing, but vary in need based on what the developer wants to make.
To learn more about Swift and programming and get content like this, make sure to follow me! Thank you, the support means a lot!!!
ORIGINAL POST LINK: https://medium.com/swlh/should-you-use-swiftui-or-the-interface-builder-storyboard-for-your-next-project-a58c496d01