Files
featherVoice/QXLive/Tools/QXFloatAnimationHelper.h

46 lines
1.3 KiB
C
Raw Permalink Normal View History

2025-11-28 22:43:06 +08:00
//
// QXFloatAnimationHelper.h
// QXLive
//
// Created by 启星 on 2025/11/22.
//
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, FloatAnimationStyle) {
FloatAnimationStyleSmooth, // 平滑漂浮
FloatAnimationStyleBounce, // 弹跳漂浮
FloatAnimationStyleWave, // 波浪漂浮
FloatAnimationStyleBreath // 呼吸式漂浮
};
@interface QXFloatAnimationHelper : NSObject
@property (nonatomic, assign) FloatAnimationStyle style;
@property (nonatomic, assign) CGFloat amplitude; // 浮动幅度
@property (nonatomic, assign) NSTimeInterval duration; // 单次循环时长
@property (nonatomic, assign) BOOL autoStart; // 是否自动开始
// 单例
+ (instancetype)sharedController;
// 为视图添加漂浮动画
- (void)addFloatAnimationToView:(UIView *)view;
- (void)addFloatAnimationToView:(UIView *)view withStyle:(FloatAnimationStyle)style;
// 为多个视图添加漂浮动画(带随机延迟)
- (void)addFloatAnimationToViews:(NSArray<UIView *> *)views;
// 移除漂浮动画
- (void)removeFloatAnimationFromView:(UIView *)view;
- (void)removeAllFloatAnimations;
// 暂停和恢复动画
- (void)pauseFloatAnimationForView:(UIView *)view;
- (void)resumeFloatAnimationForView:(UIView *)view;
@end