April 2020
Beginner
316 pages
8h 20m
English
Creating the UI programmatically involves writing around five lines of code, such as in the following example:

As seen in the preceding screenshot, you first need to create an instance of the UIButton, set the frame (origin and size), set the background color, give the button's label some text, set a tap gesture (what happens when you tap the button), and then add the gesture to the button.
All this is done before we even place the button within our view hierarchy, not to mention writing the code to determine what happens when we tap the button.
All in all, quite a few lines of code—for something that could ...
Read now
Unlock full access