To create a label in Swift, you can follow these steps:
UILabel
object from the object library onto your view controller.Here is an example of how to create a label and set its text programmatically:
main.swift131 chars4 lines
This creates a new UILabel
object with a frame of (50, 50, 200, 50) and sets its text to "Hello, world!". Finally, it adds the label to the current view as a subview.
gistlibby LogSnag