4

I have decided to create my UI programmatically as oppose to storyboards to avoid merge conflict nightmares and a few other things. However, I'm running to a few problems:

  1. How would I do size classes?
  2. My viewDidLoad methods are usually very large which reduces the readability of the code. Any suggestions or best practices?
Peyman
  • 3,059
  • 1
  • 33
  • 68

1 Answers1

0

1) Using size classes programmatically,
Programmatically implementing two different layouts using size classes,
http://www.digistarters.com/swift-autolayout-and-size-classes-programmatically
2) Constraints may take a big place in your viewDidLoad method if you create all of this programmatically. I moved from fully-coded-UI to xibs and storyboards couple of years ago, and now my life much easier. Also, when view controller becomes too long, you can try this methodology Viper.

Community
  • 1
  • 1
shpasta
  • 1,913
  • 15
  • 21
  • I actually like your suggestion, like majority of my code is the table view cells which can be xibs I suppose. – Peyman Jan 22 '16 at 00:29