https://github.com/johnvuko/jtimagelabel
JTImageLabel keeps a UILabel and a UIImageView side by side on iOS.
https://github.com/johnvuko/jtimagelabel
Last synced: about 1 year ago
JSON representation
JTImageLabel keeps a UILabel and a UIImageView side by side on iOS.
- Host: GitHub
- URL: https://github.com/johnvuko/jtimagelabel
- Owner: johnvuko
- License: mit
- Created: 2014-11-10T16:46:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-03T17:15:49.000Z (over 10 years ago)
- Last Synced: 2025-04-06T21:01:36.695Z (about 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 141 KB
- Stars: 79
- Watchers: 6
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JTImageLabel
[](https://travis-ci.org/jonathantribouharet/JTImageLabel)



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](http://cocoapods.org/), add this line to your Podfile.
pod 'JTImageLabel', '~> 1.0'
## Screenshots

## Usage
It's very easy to use.
```objective-c
#import
#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.
```objective-c
@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
- [Jonathan Tribouharet](https://github.com/jonathantribouharet) ([@johntribouharet](https://twitter.com/johntribouharet))
## License
JTImageLabel is released under the MIT license. See the LICENSE file for more info.