SkillAgentSearch skills...

DHExpandableLabel

DHExpandableLabel is a simple UILabel subclass that shows a tappable link if the content doesn't fit the specified number of lines. If touched, the label will expand to show the entire content.

Install / Use

/learn @mrvandai/DHExpandableLabel
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Version License Platform Swift Version

DHExpandableLabel

DHExpandableLabel is a simple UILabel subclass that shows a tappable link if the content doesn't fit the specified number of lines. If touched, the label will expand to show the entire content.

Usage

let label = DHExpandableLabel(frame: rect)

let loremText = "Lorem Ipsum is dummy text of the print and typesetting industry. Lorem Ipsum has been thm Ipsum, Lorem Ipsum is simplyLorem Ipsum is simplyLorem Ipsum is simply"

label.numberOfLines = 2

label.shouldAddSpaceBetweenEllipsisAndMore = true

label.shouldTrimLeftSpace = true

label.delegate = self

label.shouldCollapse = true

label.originAttributedText = NSAttributedString(string: loremText, attributes: attributed)

Installation

Available in Cocoa Pods:

pod 'DHExpandableLabel'

References

ExpandableLabel

License

DHExpandableLabel is available under the MIT license. See the LICENSE file for more info.

Related Skills

View on GitHub
GitHub Stars17
CategoryProduct
Updated9mo ago
Forks5

Languages

Swift

Security Score

82/100

Audited on Jul 4, 2025

No findings