First, set the frame to the label you want to create.
LetTextlabel =UILabel(Frame:CGRectMake( Self.View.Frame.size.width/8, -, Self.View.Frame.size.width*3/4, -))
Set a value for a label
Textlabel.text = "Now let's start learning how to create our first Swift control-uilabel"
Set whether to default line wrapping
textlabel.numberoflines = 0
Set the label's background color
varWhitcolor =Uicolor(Red:1.0, Green:1.0, Blue:1.0, Alpha:1.0)
Textlabel. backgroundcolor = Whitcolor
Sets the text information presentation style for the label,
Textlabel.TextAlignment = Nstextalignment. Left
Set the font for a label
varTextfont =Uifont(Name:Nil, Size: One)
Textlabel. Font = Textfont
Set the text color of a label
varGreencolor =Uicolor(Red:0.9, Green:0.2, Blue:0.6, Alpha:1.0)
Textlabel. TextColor = Greencolor
Adding views to view
Self.View.Addsubview(Textlabel)
Swift Basic Tutorial (Swift code creates the Uilabel of the first control)