Latest 1.3
Homepage https://github.com/hayek/UIReadMoreLabel
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, CoreGraphics, UIKit
Authors

UIReadMoreLabel is an UILabel extention that supports truncation string for "read more" cases when the text is too large to fit the UILabel frame.

UIReadMoreLabel supports dynamic font size and attributed string values.

License
cocoapods

UIReadMoreLabel

Usage

To use UIReadMoreLabel, create a UIReadMoreLabel programaticly or set a UILabel’s class to UIReadMoreLabel in storyboard.

An example of making a UIReadMoreLabel:

UIReadMoreLabel *readMoreLabel = [[UIReadMoreLabel alloc] initWithFrame:self.view.bounds];
[readMoreLabel setTruncationString:@"... Continue Reading"];

[self.view addSubView:readMoreLabel];

There’s also isTruncated property that will be set to YES in case the text was truncated.

Installation

UIReadMoreLabel is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'UIReadMoreLabel', '~> 1.3'

Or Manually add the two files into your Xcode project:

  • UIReadMoreLabel.h
  • UIReadMoreLabel.m

How it works

UIReadMoreLabel sets the font to the minimum font size and removes characters till it fit in the frame, then replaces the last string with the truncationString.

License

UIReadMoreLabel is licensed under the The MIT License (MIT) license found in the LICENSE file in the root directory of this source tree.

Latest podspec

{
    "name": "UIReadMoreLabel",
    "version": "1.3",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/hayek/UIReadMoreLabel",
    "authors": {
        "Amir Hayek": "[email protected]"
    },
    "summary": "An UILabel extention that supports customized truncation string",
    "description": "UIReadMoreLabel is an UILabel extention that supports truncation string for "read more" cases when the text is too large to fit the UILabel frame. UIReadMoreLabel supports dynamic font size and attributed string values.",
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/hayek/UIReadMoreLabel.git",
        "tag": "1.3"
    },
    "source_files": "UIReadMoreLabel/UIReadMoreLabel.{h,m}",
    "frameworks": [
        "Foundation",
        "CoreGraphics",
        "UIKit"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This