A UIKit port of the AestheticText library that creates more pleasing wrap behavior for UILabel components.
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.
- 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
Add AestheticLabel to your project using Swift Package Manager:
dependencies: [
.package(url: "path/to/AestheticLabel", from: "1.0.0")
]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 = 0The 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.
- iOS 13.0+
- Swift 6.0+