Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sephiroth87/odmulticolumnlabel
A UILabel replacement that renders text on multiple columns, comes in both Objective-C and Swift versions
https://github.com/sephiroth87/odmulticolumnlabel
Last synced: about 6 hours ago
JSON representation
A UILabel replacement that renders text on multiple columns, comes in both Objective-C and Swift versions
- Host: GitHub
- URL: https://github.com/sephiroth87/odmulticolumnlabel
- Owner: Sephiroth87
- License: mit
- Created: 2014-07-31T22:34:45.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-12T11:43:17.000Z (almost 8 years ago)
- Last Synced: 2024-10-31T16:09:59.102Z (7 days ago)
- Language: Objective-C
- Homepage:
- Size: 25.4 KB
- Stars: 45
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.textile
- License: LICENSE.txt
Awesome Lists containing this project
README
h1. ODMultiColumnLabel
!http://www.orangeinaday.com/img/ODMultiColumnLabel.jpg!
ODMultiColumnLabel is a UILabel replacement that renders text on multiple columns, without any major hassle, available in both Objective-C and Swift
h2. Requirements
Since it's based on TextKit, ODMultiColumnLabel requires iOS 7.0 or greater
h2. Installation
h4. Objective-C
__*Important note if your project doesn't use ARC*: you must add the @-fobjc-arc@ compiler flag to @ODMultiColumnLabel.m@ in Target Settings > Build Phases > Compile Sources.__
* Drag @ODMultiColumnLabel.h@ and @ODMultiColumnLabel.m@ from the @ODMultiColumnLabel@ folder into your project
* @#import "ODMultiColumnLabel.h"@h4. Swift
* Drag @ODMultiColumnLabel.swift@ from the @ODMultiColumnLabel@ folder into your project
h2. Usage
(see sample Xcode project in @/Demo@)
Create the label as normal, via code or Interface Builder
h3. Customization
The @ODMultiColumnLabel@ can be customized using all normal UILabel properties, using normal or attributed strings, plus the following properties:
h4. Objective-C
@property (nonatomic, assign) NSUInteger numberOfColumns; // default is 1
@property (nonatomic, assign) CGFloat columnsSpacing; // default is 14.0h4. Swift
var numberOfColumns: UInt = 2
var columnsSpacing: CGFloat = 14.0h2. Known limitations
* Currently, ODMultiColumnLabel works best if the label has no fixed height, either using Autolayout's intrinsic content size or -sizeToFit. Forcing a smaller height to the label will currently crop the bottom part
* lineBreakMode is currently ignored, partially for the reason above, but also because there seems to be a bug with NSLayoutManagerh2. Credits
ODMultiColumnLabel is brought to you by "Fabio Ritrovato":http://orangeinaday.com and "contributors to the project":https://github.com/Sephiroth87/ODMultiColumnLabel/contributors. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by "creating new issues":https://github.com/Sephiroth87/ODMultiColumnLabel/issues/new. If you're using ODMultiColumnLabel in your project, attribution would be nice.