- Notifications
You must be signed in to change notification settings - Fork3
License
NotificationsYou must be signed in to change notification settings
badoo/HyperLabel
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
HyperLabel is a UILabel replacement which suports adding links for arbitraray part of the text
HyperLabel supports setting customaccessibilityIdentifier
for added links
All added links will have proper description and will be accessible with VoiceOver
If you already have a subclass of UILabel, you can add HyperLabel functionallity to it. Just by conform it toHyperLabelProtocol
and callinitializeHyperLabel
letlabel=HLHyperLabel()// Set additional attributes which will be applied for added linkslabel.additionalLinkAttributes=[NSAttributedString.Key.foregroundColor:UIColor.red,NSAttributedString.Key.underlineStyle:NSUnderlineStyle.single.rawValue]// Set textlabel.text="Hello world!"// Get range of the linkletlinkRange=(textasNSString).range(of:"world")// Add handler for rangelabel.addLink(withRange: linkRange){ // On link press}
Add HyperLabel to your Cartfile:
github "badoo/HyperLabel"
- Add as a submodule ordownload
- Drag
HyperLabel.xcodeproj
inside of your project - Add
HyperLabel.framework
to Target Dependencies - Add
HyperLabel.framework
to Embedded Binaries
Source code is distributed under MIT license
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages0
No packages published