Skip to content

UILabel replacement to draw NSAttributedString or HTML with custom font and color in iOS applications. "numberOfLines" and "truncation" (NSLineBreakByTruncatingTail) is supported.

License

Notifications You must be signed in to change notification settings

richarddas/CoreTextLabel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoreTextLabel

UILabel replacement to draw NSAttributedString or HTML with custom font and color in iOS applications. "numberOfLines" and "truncation" (NSLineBreakByTruncatingTail) is supported.

Example

    CoreTextLabel * label  = [[CoreTextLabel alloc] initWithFrame:frame];
    label.string           = [label attributedStringByHTML:htmlString];
    [label sizeToFit];
    [self.view addSubview:label];


Install

Add CoreTextLabel pod to your Podfile.

$ vim Podfile
platform :ios, '5.0'
pod 'CoreTextLabel', :head

And then you install the dependencies in your project.

$ pod install

Remember to always open the Xcode workspace instead of the project file when you're building.

$ open App.xcworkspace

Requirements

CoreTextLabel 1.0 and higher requires iOS 3.2 and above.

Framework dependencies

  • QuartzCore
  • CoreText

ARC

CoreTextLabel uses ARC as of its 1.0 release.

If you are using CoreTextLabel 1.0 in your non-arc project, you will need to set a -fobjc-arc compiler flag on all of the CoreTextLabel source files.

To set a compiler flag in Xcode, go to your active target and select the "Build Phases" tab. Now select all CoreTextLabel source files, press Enter, insert -fobjc-arc or -fno-objc-arc and then "Done" to enable or disable ARC for CoreTextLabel.

Credits

CoreTextLabel was created by Daniel Kuhnke for appfarms GmbH & Co. KG

License

CoreTextLabel is available under the MIT license. See the LICENSE file for more info.

About

UILabel replacement to draw NSAttributedString or HTML with custom font and color in iOS applications. "numberOfLines" and "truncation" (NSLineBreakByTruncatingTail) is supported.

Resources

License

Stars

Watchers

Forks

Packages

No packages published