How to use Uilabel
Let Label:uilabel = UILabel (Frame:cgrect (x:0, y:100, Width:view.frame.size.width, height:100))
Label.text = "Everybody loves Uncle Meng old, do not take medicine every day"
Label.textalignment = Nstextalignment.center
Label.numberoflines = 2
Set the display mode for text too long
Label.linebreakmode = Nslinebreakmode.bytruncatingmiddle
Automatically scale fonts according to text boxes for full display purposes
Label.adjustsfontsizetofitwidth = True
Font size Bold
Label.font = uifont.boldsystemfontofsize (14)
Normal
Label.font = uifont.systemfontofsize (14)
Label.textcolor = Uicolor.bluecolor ()
Set Shadow
Label.shadowcolor = Uicolor.cyancolor ()
Label.shadowoffset = Cgsizemake (1.0, 1.0)
Add a text label to the view
View.addsubview (label)
Add a click event to a label
Label.userinteractionenabled = True
Let Tap:uitapgesturerecognizer = UITapGestureRecognizer (target:self, Action: "Tap:")
Label.addgesturerecognizer (TAP)
}
Func Tap (Tap:uitapgesturerecognizer) {
Print ("Tihis is Click")}
The label of Swift Learning