Latest 1.0.2
Homepage https://github.com/jonathantribouharet/JTImageLabel
License MIT
Platforms ios 7.0, requires ARC
Authors

CI Status
Version
License
Platform

JTImageLabel is a simple view which contain a UILabel and a UIImageView which stay side by side, even if you change the alignment of the UILabel.

Installation

With CocoaPods, add this line to your Podfile.

pod 'JTImageLabel', '~> 1.0'

Screenshots

Example

Usage

It’s very easy to use.

#import <UIKit/UIKit.h>

#import "JTImageLabel.h"

@interface ViewController : UIViewController

@property (weak, nonatomic) IBOutlet JTImageLabel *label;

@end

You can access directly to the imageView and the textLabel.
Also you can define the space between the two views.

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.label.imageView.image = [UIImage imageNamed:@"icon"];
    self.label.textLabel.text = @"Test";
    self.label.textLabel.textAlignment = NSTextAlignmentRight;
    self.label.space = 10.; // Add a space between the imageView and the textLabel
}

You cannot change the frame of the imageView and the textLabel. The imageView has the same size as this image and the textLabel adapts to its relative content.

Requirements

  • iOS 7 or higher
  • Automatic Reference Counting (ARC)

Author

License

JTImageLabel is released under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "JTImageLabel",
    "version": "1.0.2",
    "summary": "JTImageLabel keeps a UILabel and a UIImageView side by side.",
    "homepage": "https://github.com/jonathantribouharet/JTImageLabel",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Jonathan Tribouharet": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/jonathantribouharet/JTImageLabel.git",
        "tag": "1.0.2"
    },
    "source_files": "JTImageLabel/*",
    "requires_arc": true,
    "screenshots": [
        "https://raw.githubusercontent.com/jonathantribouharet/JTImageLabel/master/Screens/example.png"
    ]
}

Pin It on Pinterest

Share This