1

Is it a good practice to have nested vertical or horizontal StackViews in my project there is requirement to do so or is there any other way to avoid this or it is okay to use nested vertical StackViews.

Storyboard looks like below it is working fine and UI is appearing as expected across resolution but not sure if it is good practice or not

enter image description here

Zouhair Sassi
  • 1,403
  • 1
  • 13
  • 30
alphanso
  • 409
  • 5
  • 22

1 Answers1

0

As always there are Pros and Cons.

Pro:

  • Layout structure is easily comprehensive
  • You can hide/show groups of views very easily
  • Saves time towards doing all things with constraints
  • Reordering is a lot easier

Con:

So you have to decide or test in your own situation, if you notice any performance issues. Maybe use an older device like iPhone 6 or so and try to open your view controller that contains this layout and check if it lags or so.

heyfrank
  • 5,291
  • 3
  • 32
  • 46
  • It is not a table view cell and there is no scroll as well I guess less chances of performance issues ? – alphanso Jul 18 '19 at 08:39
  • Yep than you should be fine. You may encounter a split second of a lag when loading this ViewController, but most users won't notice. – heyfrank Jul 18 '19 at 08:43