Today, we will talk about the Storyboard and latest technology Swift UI that has been launched by Apple recently. Let’s talk about SwiftUI or Storyboards.
Ever wondered why all of a sudden there is a drastic change in the design pattern of Apple software development? Even though most of us are familiar with the pros and cons of the storyboard design pattern, there are some things that you need to know at first to understand the evolving differences in its usability.
While developing the iOS or Mac application, the first thing comes into mind is whether to use Storyboard or no Storyboard? Most of the newbies or developers with lesser years of experience often use Storyboard for UI Designing but as the app size grows, it becomes difficult to manage the UI design with an increasing number of views.
The problem arises the moment when you’re working on a project with multiple developers as you have to merge codes across the server. Storyboard original code is a set of complex XML file which is too complex to understand. That’s a major drawback of using a Storyboard and for avoiding such problems you have to divide your project into a small independent module. This concept is termed as “Less Coupling and more Cohesion” in a language of Software Engineering.
Even though if developers start learning the technique of making multiple storyboards to avoid such problems, working with multiple storyboards won’t help as merging the codes on GiT will result in a serious time-loss while resolving unnecessary conflict. Moreover, storyboard is less of the reusable entity.
Another solution to the problem is a “Programmatically designed UI”. When you are working on a big project you will find it useful to design the UI programmatically as you can reuse it to a greater extent. However, creating the UI programmatically is not an easy task as it demands adequate experience in development.
class TestCell: UITableViewCell { let testImageView: UIImageView = { $0.contentMode = .scaleToFill 0.clipsToBounds = true 0.image = UIImage(named: "image_1") return $0 }(UIImageView()) override func setupLayout() { super.setupLayout() addSubview(testImageView) testImageView.snp.makeConstraints { (make) in make.height.equalTo(50) make.width.equalTo(50) make.centerY.equalTo(self.snp.centerY) make.centerX.equalTo(self.snp.centerX) } } }
You must be judging yourself as creating such kind of codes demands expertise. Also, you have to compile the whole source code even for small changes and this eventually elongates the timeline for development.
PROS:
CONS:
1.Performance issue when app size increases.
2.The development process is slow as you have to work with heavy codes.
3.Worst merging experience.
PROS:
CONS:
1.Requires enough expertise for iOS app development.
2.Small changes required in compilation of source codes.
To eliminate such problems, Apple has introduced Swift UI.
Here you can see that some lines of code can do more of the work.
In my opinion, Apple brought major changes in its development technique which is quite surprising for the majority of developers at first but as I can see that this is a much better option rather than resolving the conflict on a server and handling a larger bunch of codes.
Copyright © 2022 MobileCoderz
Leave a Reply