1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // XYLabelAnimation.h
- // Starbuds
- //
- // Created by 翟玉磊 on 2020/3/11.
- // Copyright © 2020 翟玉磊. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- NS_ASSUME_NONNULL_BEGIN
- typedef enum {
- XYLabelAnimationTypeNormal = 0,
- XYLabelAnimationTypeWave = 1
- }XYLabelAnimationType;
- @interface XYLabelAnimation : UILabel
- @property (nonatomic, copy) NSString *text;
- @property (nonatomic, copy) NSAttributedString *attributedText;
- @property (nonatomic, assign) XYLabelAnimationType type;
- /// 动画高度
- @property (nonatomic, assign) CGFloat animationHeight;
- /// label文字跳动速度 1~10 默认2
- @property (nonatomic, assign) NSUInteger rate;
- /// 文字之间的间距
- @property (nonatomic, assign) CGFloat kerning;
- - (instancetype)initWithFrame:(CGRect)frame text:(NSString *)text;
- - (instancetype)initWithFrame:(CGRect)frame attributedText:(NSAttributedString *)attributedText;
- - (void)startAnimation;
- - (void)pauseAnimation;
- - (void)stopAnimation;
- @end
- NS_ASSUME_NONNULL_END
|