A UILabel with marquee effect
#Installing ##CocoaPods
- Add
pod 'RYMarqueeLabel'to your Podfile. - Run
pod installorpod update. - Import "RYMarqueeLabel.h".
##Manually
- Drag the
RYMarqueeLabelfolder to your project. - Import "RYMarqueeLabel.h".
#Usage
If you want to know more details, please reference to the demo :]
#import "RYMarqueeLabel.h"
@property (nonatomic, strong) RYMarqueeLabel *label;
- (void)viewDidLoad {
[super viewDidLoad];
[self.view addSubview:self.label];
[self.label startAnimation];//< dont't forget call this func
}
- (RYMarqueeLabel *)label {
if(_label) return _label;
_label = [[RYMarqueeLabel alloc] initWithFrame:(CGRect){.size = {100, 50}}];
// if you just want to set a single text
_label.text = @"Some words";
_label.textColor = [UIColor grayColor];
_label.font = [UIFont systemFontOfSize:17.f];
...
// if you have a text array and want to loop it or not
_label.texts = @[@"Hi", @"How are u", @"I'm fine"];
_label.enabelLoop = YES;
// if you want to modify the animation durition
_label.displaiedDuration = 2.f;
_label.animationDuration = 5.f;
// if you want to change the default animation effect
_label.effect = kBottomToTop;
return _label;
}
#ChangeLog ##Version: 1.0.1 Fix a bug ##Version: 1.0.0 Initial Build #License MIT License