UILabel Basics

This post was transferred from my Xalting.com site.

UILabels are the basic component of almost any app. This post includes a video which will demonstrate how to make a simple app using the UILabel.

Please use the video below to learn how to make a simple on-off app using the UILabel. (Please Note that the video had to be split into two parts and have no sound as they were recorded in a noisy place and the site maximum file size was being exceeded. We apologize for the inconvenience and the video will be re-recorded soon.)

To recap, to insert a UILabel into an Xcode Project:
1. Add to View Controller
2. Add IBOutlet of UILabel
3. Use the following code to change value of UILabel:

[LABELNAME].text = "Example"
//Please change "[LABELNAME]" to the name of the UILabel initialized 
  in the IBOutlet

You may perform code based on the value of a UILabel using the code below:

if [LABELNAME].text == "Example" {
//perform code here
}

Leave a Comment

Your email address will not be published. Required fields are marked *