Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Storyboards Should I use them or not? [duplicate]

I am new to iOS development (No apps created yet), but I ask for advice from my friend that has really high rated apps on the market. He said not to use storyboards.

As much as I want to take his advice, they seem really helpful.

  • Is this something that can cause problems for my app in the future?
  • Is there any reason I may want to not use storyboards?

Coming from an Android background, I don't see why I should use them.

like image 981
EGHDK Avatar asked Dec 15 '12 03:12

EGHDK


People also ask

Should you use storyboards iOS?

Using storyboards is easier for new iOS developers than building a user interface entirely in code. Dragging a button or other control to a screen is easier than figuring out the code you have to write to create and place that control. Storyboards let you see how your interface looks before running the app.

Can we use multiple storyboards in one application?

A storyboard is meant to explain a story, not a saga. An app's storyboard can be easily divided into multiple storyboards, with each one representing an individual story.

Should I use storyboards or SwiftUI?

After looking at the pros and cons of both Storyboard and SwiftUI, according to my opinion building app UI using storyboard is comparatively easier for a beginner, and has been there was a very long time, but there are some flaws with it and that flaws have been taken care of in Swift UI.

Which is better storyboard or xib?

If you are a single developer, it is good to use storyboard because it consumes less time. If the team consists of many developers, use xib, otherwise, it is not easy to merge the modules/tasks.


2 Answers

I tend to avoid storyboards for anything apart from perhaps a quick prototype. If you know you have a very simple app which isn't going to get complicated, and you're the only developer, storyboards might be ok.

Here are a few blog posts that detail some of the pain points when using storyboards:

  • http://toxicsoftware.com/uistoryboard-issues.html

  • http://blog.waynehartman.com/archive/2012/01/07/uistoryboard-on-ios-5-the-good-the-bad-and-the.aspx

Both of the above are a bit dated, but I believe the pertinent points still hold true.

Note that in theory you need to use a storyboard(s) to get static tables, which can be useful. To get this benefit, you could put only the static tables in storyboard files (note: you can have multiple storyboard files in an app) and use xibs or just code for the rest of the UI.

like image 164
occulus Avatar answered Sep 27 '22 18:09

occulus


I'd recommend against using either storyboards or Interface Builder.

  • You'll learn Objective-C faster if you spend more time using it. Switching between IB and code, you'll have two things to learn. The context switching will still slow you down later on.
  • Nibs and storyboards are big XML files that don't play well with source control; if you're working on one at the same time as someone else, you will get merge conflicts.
  • You can't see everything that's going on at once in IB, so it's hard to track down things like layout problems.
  • You can't search or replace in IB the way you can in code
  • Nibs and storyboards put your view logic in your controllers. Whether that's a problem for you depends on how much of an MVC purist you are.
  • If you want to port your apps to/from Android, IB will make it much harder.

This all comes from experience. I started out running a small software team developing iOS apps using IB (storyboard wasn't out yet) and within a year it had caused so many problems that I'd had to forbid its use. Our productivity went way up when we stopped using it.

like image 27
Simon Avatar answered Sep 27 '22 18:09

Simon