修复聊天大厅bug
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// CALayer+Animation.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2024/5/6.
|
||||
//
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface CALayer (Animation)
|
||||
// 暂停动画
|
||||
- (void)ms_pauseAnimate;
|
||||
|
||||
// 恢复动画
|
||||
- (void)ms_resumeAnimate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,29 +0,0 @@
|
||||
//
|
||||
// CALayer+Animation.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2024/5/6.
|
||||
//
|
||||
|
||||
#import "CALayer+Animation.h"
|
||||
|
||||
@implementation CALayer (Animation)
|
||||
// 暂停动画
|
||||
- (void)ms_pauseAnimate {
|
||||
CFTimeInterval pausedTime = [self convertTime:CACurrentMediaTime() fromLayer:nil];
|
||||
self.speed = 0.0;
|
||||
self.timeOffset = pausedTime;
|
||||
}
|
||||
|
||||
// 恢复动画
|
||||
- (void)ms_resumeAnimate {
|
||||
|
||||
CFTimeInterval pausedTime = [self timeOffset];
|
||||
self.speed = 1.0;
|
||||
self.timeOffset = 0.0;
|
||||
self.beginTime = 0.0;
|
||||
CFTimeInterval timeSincePause = [self convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;
|
||||
self.beginTime = timeSincePause;
|
||||
|
||||
}
|
||||
@end
|
Reference in New Issue
Block a user