Skip to content

lonepalm/AestheticLabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AestheticLabel

A UIKit port of the AestheticText library that creates more pleasing wrap behavior for UILabel components.

Overview

AestheticLabel provides AestheticLabel, a UILabel-like class that automatically adjusts text wrapping to make lines as equal in length as possible, creating more visually appealing text layouts.

Features

  • AestheticLabel: A UILabel-like view with improved text wrapping
  • Performance optimized: Uses caching to avoid redundant calculations
  • Drop-in replacement: Compatible with all UILabel properties

Installation

Swift Package Manager

Add AestheticLabel to your project using Swift Package Manager:

dependencies: [
    .package(url: "path/to/AestheticLabel", from: "1.0.0")
]

Usage

import AestheticLabel

let label = AestheticLabel()
label.text = "Your text here that will wrap more aesthetically"
label.font = UIFont.systemFont(ofSize: 18)
label.textAlignment = .center
label.numberOfLines = 0

How it works

The library uses a binary search algorithm to find the smallest possible width that doesn't increase the text height, effectively making text lines as equal in length as possible. This creates more balanced and visually appealing text layouts.

Requirements

  • iOS 13.0+
  • Swift 6.0+

About

UIKit port of the AestheticText library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages