UILabel | How to use UILabel in iOS Development | Xcode 9 | Swift4



UILabel | How to use UILabel in iOS Development | Xcode 9 | Swift4

UILabel | How to use UILabel in iOS Development | Xcode 9 | Swift4

Topic: UILabel | How to use UILabel in iOS Development | Xcode 9 | Swift4

UILabel
A view that displays one or more lines of read-only text, often used in conjunction with controls to describe their intended purpose.
SDKs

Overview
The appearance of labels is configurable, and they can display attributed strings, allowing you to customise the appearance of substrings within a label. You can add labels to your interface programmatically or by using Interface Builder.
The following steps are required to add a label to your interface:
Supply either a string or an attributed string that represents the content.
If using a not attributed string, configure the appearance of the label.
Set up Auto Layout rules to govern the size and position of the label in your interface.
Provide accessibility information and localised strings.

Attribute
Description
Text
Specifies the content of the label. Set the mode to Plain to display the label’s content with a uniform appearance. Set the mode to Attributed to apply styling attributes selectively within the string. In addition to the styling attributes detailed in this table, when the mode is set to Attributed you can use the More menu to reveal additional appearance attributes. Access this value at runtime with the
text
and
attributedText
properties for the Plain and Attributed modes, respectively.
Color
Controls the color of the text in the label. In Plain configuration, specifies the color of the entire label. In Attributed mode, select a part of the string and use the color cell to set the color of the selection.
Font
Specifies the font of the string in the label. In Plain configuration, specifies the font for the entire label. In Attributed mode, use the font panel to specify the fonts used within the attributed string.
Alignment
Controls the horizontal alignment of the text within the label. Choose left, right, center, justified, or natural, which chooses either left or right depending on the current localization of the app. In Plain configuration, the alignment affects the content of the entire label. In Attributed mode, you can control the alignment of individual paragraphs.
Lines
Specifies the maximum number of lines the label will use to render the text. Set to 0 to use as many lines as required. Access this value at runtime with the
numberOfLines
property.
Behavior
Both Enabled and Highlighted control the appearance of the label, representing the
isEnabled
and
isHighlighted
properties, respectively. When Enabled is unchecked, the text is drawn dimmed to indicate that it is inactive. When Highlighted is checked, the text is rendered in the Highlighted color.
More details: https://developer.apple.com/documentation/uikit/uilabel
=================================================

* Subscribe us:
– Youtube: https://goo.gl/xwm3Pv
– Facebook: https://www.facebook.com/somrithchhean/
– Twitter: www.twitter.com
– Medium: https://goo.gl/Hi9agQ
– Website: www.somrithchhean.com

* Partnership with iKhmer4ever:
Facebook Page: https://goo.gl/W8Vjnu
Youtube Channel: https://goo.gl/fkjM8I
Website:http://www.ikhmer4ever.com
Twitter: https://twitter.com/ikhmer4ver
Medium: https://medium.com/@ikhmer4ever

Free Android Training here:
– http://bit.ly/2ctZrZM
– https://www.youtube.com/watch?v=HvgzzuYV4WA&list=PLcwcuvlq19zzoMZL1C4UGmiF3EANHqHR0

Free iOS Training here:
– http://bit.ly/2ctG5GX
– https://www.youtube.com/watch?v=MG3y42E3ipQ&list=PLcwcuvlq19zwZhw-PNP8QrDWhKC9-UWIY

More video mobile app training:
1. https://youtu.be/bA2wDt7MznE
2. https://www.youtube.com/watch?v=8x64hzj4xko
3. https://www.youtube.com/watch?v=AnHH6MOcEac
4. https://www.youtube.com/watch?v=5pTh133mbpI
5. https://www.youtube.com/watch?v=5df2vN9HcY4
6. https://www.youtube.com/watch?v=XUWsmLaXBmE
7. https://www.youtube.com/watch?v=39P-KGTpdTs
8. https://www.youtube.com/watch?v=umpktKQxdbo
9. https://www.youtube.com/watch?v=FoN4etY7cAo
10. https://www.youtube.com/watch?v=hDBURPB09wA #somrithchhean #tutorials #design

Comments are closed.