Skip to content

hons82/UILabel-PinchZoom

Repository files navigation

UILabel+PinchZoom

Pod Version Pod Platform Pod License

Simple pinch-zoom category for UILabel.

This clearly inspired by UITextView-PinchZoom who is the real author of the category. I just made some adaptions to have it working on UILabel and a sample program to show how it can be implemented using storyboard

Installation

CocoaPods

Install with CocoaPods by adding the following to your Podfile:

platform :ios, '4.3'
pod 'UILabel+PinchZoom', '~> 0.0.2'

Note: We follow http://semver.org for versioning the public API.

Manually

Or copy the UILabel-PinchZoom/ directory from this repo into your project.

Usage

This is how you can create it:

#import "UILabel+PinchZoom.h"

//...

UILabel *label = [[UILabel alloc] initWithFrame:self.view.frame];
[self.view addSubview:label];
label.zoomEnabled = YES;
label.minFontSize = 10;
label.maxFontSize = 40;

Usually you'll nest it into a UIScrollview which will force you to do something like this in most cases

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    [self.commentLabel setNeedsLayout];
}

Have a look at the Example Project for more details

#Contributions

...are really welcome. If you have an idea just fork the library change it and if its useful for others and not affecting the functionality of the library for other users I'll insert it

License

Source code of this project is available under the standard MIT license. Please see the license file.

About

Simple pinch-zoom category for UILabel

Resources

License

Stars

Watchers

Forks

Packages

No packages published