Whether or not to use Mainstoryboard Swift

Asked

Viewed 117 times

0

I started my studies in Swift, currently I am studying Swift 4, but I have come across a question, which I believe many people who are starting have (or not).

In the course I see, the teacher teaches us to develop apps using the famous Drag and Drop of MainStoryBoard.

However, in another series (gringo), I saw the teacher teaching without the use of the MainStoryBoard, right away, it deletes this file, and everything it does (literally) is in the code, from the constraints to each element of the app.

Then I wondered, what is the right way to develop apps, what are my limitations using MainStoryBoard?

  • There’s no imitation. It’s just a matter of personal preference. I suggest you learn how to use the Xcode Interface Builder and do everything that refers to layout on it. If you are finding it difficult to auto layout in the Builder interface imagine if you had to do programmatically.

  • @Leodabus I’m not finding it hard, so far it’s quiet, I just don’t like these very much interface Builder, I always prefer to do everything on the nail, but whether you like it or not, it gives a lot of work, and so I wanted to know the limitations.

  • If you can learn both ways even better

  • @Leodabus then I’ll do it, learn both.

  • Study a lot stack views which is the most important https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/LayoutUsingStackViews.html

  • If you have any links that you think are relevant... And Thank You.

  • https://developer.apple.com/videos/play/wwdc2017/412/

Show 2 more comments

2 answers

1

For me to use the .storyboard I pretty much limit the drag and drop at the beginning until it goes, because you need to know how the components on the screen work, how the constraints work etc. However, as you evolve, will feel the need to make some changes to the components and your changes can only be made by code. The coolest thing to do via code is that you will understand how the component will actually behave on the screen without having to do a unwrapped force when you drag and drop a storyboard button to VC.

1

IMO This issue is more than a matter of preference.

The use of Storyboard actually makes certain options and settings simpler and more visual, but will be better used in smaller and simpler projects where there is only one Veloper.

For systems with modelling architectures, larger projects and more Developers, I think the use of xib files will be more appropriate because it respects modularity and each Feature and does not waste time with merge storyboards.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.