UIKit No Storyboard: 3 ‘BASIC’ Techniques for Adapting Layouts and Designs
There are three concepts you must know when developing UIKit without storyboard. In fact, it is necessary even if you use storyboard, but it is absolutely necessary when writing a UI with pure code.
[1] Change Constants
By declaring a constraint as a global variable, you can change its constant dynamically. This technique is useful when you apply animation.
[2] Enable & Disable Constraints
This example uses two constraints as global variables, and control constraints by setting true or false. This technique is especially useful when you are building an app that supports landscape mode.
[3] Toggle Visibility
I think everyone who develops ios applications would know this already. This is really hand for various purposes. For example, you can display user login state. This isHidden property is mostly used for user interactivity in app.
Conclusion
There are 3 basic skills you need when you develop an app without Storyboard.
- Change Constants
- Enable & Disable Constraints
- Toggle Visibility