A quick helper for setting attributed texts to UILabel.

Overview

UILabelAttributedTextHelper

A quick helper for setting attributed texts to UILabel.

Screen Shot 2021-11-20 at 10 46 24 AM

Sample usage:

    label.setAttributedText(
        leadingText: "Hello!",
        leadingTextColor: .red,
        leadingTextFont: .boldSystemFont(ofSize: 20)
    )
    
    
    label2.setAttributedText(
        leadingText: "Hello",
        leadingTextColor: .blue,
        leadingTextFont: .boldSystemFont(ofSize: 20),
        trailingText: ", World!",
        trailingTextColor: .red,
        trailingTextFont: .italicSystemFont(ofSize: 20),
        textAlignment: .left,
        numberOfLines: 2,
        lineHeightMultiple: 1,
        lineSpacing: 1
    )
    
    label3.setAttributedText(
        completeString: "I believe that hard work beats talent. This is case sensitive. I learned the value of hard work by working hard",
        textColor: .label,
        font: .systemFont(ofSize: 20),
        highlightedText: "hard work",
        highlightedTextColor: .blue,
        highlightedTextFont: .boldSystemFont(ofSize: 25),
        textAlignment: .right,
        numberOfLines: 0,
        highlightAllOccurrence: false,
        lineHeightMultiple: 1,
        lineSpacing: 1
    )
    
    label4.setAttributedText(
        completeString: "I believe that hard work beats talent. This is case sensitive. I learned the value of hard work by working hard",
        textColor: .label,
        font: .systemFont(ofSize: 20),
        highlightedText: "hard work",
        highlightedTextColor: .blue,
        highlightedTextFont: .boldSystemFont(ofSize: 25),
        textAlignment: .center,
        numberOfLines: 0,
        highlightAllOccurrence: true,
        lineHeightMultiple: 1,
        lineSpacing: 1
    )
You might also like...
Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates.
Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates.

Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates. This app is available in the App

✂️ Detect and crop faces, barcodes and texts in image with iOS 11 Vision api.
✂️ Detect and crop faces, barcodes and texts in image with iOS 11 Vision api.

ImageDetect ImageDetect is a library developed on Swift. With ImageDetect you can easily detect and crop faces, texts or barcodes in your image with i

Realtime Dynamic localization translation delivery system for iOS and Mac OSX in Swift. Create and update texts from localization.com without needing to recompile or redeploy. Cocapod for iOS devices (iPad, iPhone, iPod Touch and Mac) Preview extractor for news, articles and full-texts in Swift
Preview extractor for news, articles and full-texts in Swift

ReadabilityKit Preview extractor for news, articles and full-texts in Swift We are a development agency building phenomenal apps. Features Extracts: T

It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.

Link Previewer for iOS, macOS, watchOS and tvOS It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.

Floating indicator, mimicrate to indicator which appear when silent mode turn on / off. Support large texts.
Floating indicator, mimicrate to indicator which appear when silent mode turn on / off. Support large texts.

SPIndicator About Mimicrate to indicator which appear when silent mode turn on / off. Availalbe 2 animated presets: done & error. Also support custom

Detecting Texts and Persons from Images

Detections Detecting Texts and Persons from Images Detections package will help you to get the texts from image and also recognize a person Image whih

SharePlay-TextEditor - An iOS & iPadOS application, by which people can write/edit texts and change font-styles/background color over FaceTime call
µframework for Attributed strings.

Attributed µframework for Attributed strings. What is Attributed? Attributed aims to be a drop in replacement to the current version of the NSAttribut

Easiest way to create an attributed UITextView (with support for multiple links and from html)
Easiest way to create an attributed UITextView (with support for multiple links and from html)

AttributedTextView Easiest way to create an attributed UITextView (with support for multiple links and html). See the demo app and the playground for

BonMot is a Swift attributed string library
BonMot is a Swift attributed string library

BonMot (pronounced Bon Mo, French for good word) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and

👩‍🎨 Elegant Attributed String composition in Swift sauce
👩‍🎨 Elegant Attributed String composition in Swift sauce

Elegant Attributed String composition in Swift sauce SwiftRichString is a lightweight library which allows to create and manipulate attributed strings

A Swifty API for attributed strings

SwiftyAttributes A Swifty API for attributed strings. With SwiftyAttributes, you can create attributed strings like so: let fancyString = "Hello World

Texstyle allows you to format iOS attributed strings easily.
Texstyle allows you to format iOS attributed strings easily.

Texstyle allows you to format attributed strings easily. Features Applying attributes with strong typing and autocompletion Cache for attributes Subst

An easier way to compose attributed strings
An easier way to compose attributed strings

TextAttributes makes it easy to compose attributed strings. let attrs = TextAttributes() .font(name: "HelveticaNeue", size: 16) .foregroundCol

A child view controller framework that makes setting up your parent controllers as easy as pie.
A child view controller framework that makes setting up your parent controllers as easy as pie.

Description Family is a child view controller framework that makes setting up your parent controllers as easy as pie. With a simple yet powerful publi

StyledTextKit is a declarative attributed string library for fast rendering and easy string building.
StyledTextKit is a declarative attributed string library for fast rendering and easy string building.

StyledTextKit is a declarative attributed string library for fast rendering and easy string building. It serves as a simple replacement to NSAttribute

Declarative Swift framework for Attributed Role-based Access Control management
Declarative Swift framework for Attributed Role-based Access Control management

Koosa Declarative Swift framework for Attributed Role-based Access Control management Check out this blog post for full explanation and more details:

A simple library for building attributed strings, for a more civilized age.

Veneer A simple library for building attributed strings, for a more civilized age. Veneer was created to make creating attributed strings easier to re

Owner
Glenn Posadas
iOS Engineer | Portfolio, resume, & contact info: https://www.glennvon.com | I know Nodejs-Express, AWS S3 Bucket, AWS DynamoDB, AWS EBS, and native iOS.
Glenn Posadas
Easiest way to create an attributed UITextView (with support for multiple links and from html)

AttributedTextView Easiest way to create an attributed UITextView (with support for multiple links and html). See the demo app and the playground for

Edwin Vermeer 430 Nov 24, 2022
BonMot is a Swift attributed string library

BonMot (pronounced Bon Mo, French for good word) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and

Rightpoint 3.4k Dec 30, 2022
👩‍🎨 Elegant Attributed String composition in Swift sauce

Elegant Attributed String composition in Swift sauce SwiftRichString is a lightweight library which allows to create and manipulate attributed strings

Daniele Margutti 2.9k Jan 5, 2023
A Swifty API for attributed strings

SwiftyAttributes A Swifty API for attributed strings. With SwiftyAttributes, you can create attributed strings like so: let fancyString = "Hello World

Eddie Kaiger 1.5k Jan 5, 2023
Texstyle allows you to format iOS attributed strings easily.

Texstyle allows you to format attributed strings easily. Features Applying attributes with strong typing and autocompletion Cache for attributes Subst

Rosberry 79 Sep 9, 2022
An easier way to compose attributed strings

TextAttributes makes it easy to compose attributed strings. let attrs = TextAttributes() .font(name: "HelveticaNeue", size: 16) .foregroundCol

Damien 2.2k Dec 31, 2022
A simple library for building attributed strings, for a more civilized age.

Veneer A simple library for building attributed strings, for a more civilized age. Veneer was created to make creating attributed strings easier to re

Wess Cope 26 Dec 27, 2022
More powerful label, attributed string builder and text parser.

DDText More powerful label, attributed string builder and text parser. DDLabel More powerful label than UILabel, using TextKit. It supports features b

Daniel 16 Nov 8, 2022
Easy Attributed String Creator

The main idea of this project is to have an online tool to be able to visually add formatting to a text and get back a swift and/or objective-c code t

Andres Canal 283 Dec 27, 2022
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Atributika is an easy and painless way to build NSAttributedString. It is able to detect HTML-like tags, links, phone numbers, hashtags, any regex or

Pavel Sharanda 1.1k Jan 8, 2023