当前位置:网站首页>Cabasicanimation pause \ enterprise action
Cabasicanimation pause \ enterprise action
2022-07-19 04:20:00 【Bo Bobo】
self.isAnimation = true
let rotationAnimation = CABasicAnimation.init(keyPath: "transform.rotation.z")
rotationAnimation.toValue = NSNumber(value: M_PI * 2.0)
rotationAnimation.isRemovedOnCompletion = false // Background does not stop
rotationAnimation.duration = 2 // Duration
rotationAnimation.isCumulative = true
rotationAnimation.repeatCount = MAXFLOAT;
self.playPicImg.layer.add(rotationAnimation, forKey: "rotationAnimation")
func isStartAnimation(){
if self.isAnimation {
return
}
self.isAnimation = true
let pausedTime = self.playPicImg.layer.timeOffset
self.playPicImg.layer.speed = 1.0;
self.playPicImg.layer.timeOffset = 0.0;
self.playPicImg.layer.beginTime = 0.0;
let timeSincePause = self.playPicImg.layer.convertTime(CACurrentMediaTime(), from: nil) - pausedTime
self.playPicImg.layer.beginTime = timeSincePause
}
func isStopAnimation(){
if !self.isAnimation {
return
}
self.isAnimation = false
// self.playPicImg.layer.removeAllAnimations()
let pausedTime = self.playPicImg.layer.convertTime(CACurrentMediaTime(), from: nil)
self.playPicImg.layer.speed = 0.0
self.playPicImg.layer.timeOffset = pausedTime
}
边栏推荐
- 06 MAUI,WPF使用 MVVM Toolkit 框架 构建 MVVM 程序
- IN Tech 2022|英特尔技术产品创新速览
- C# 详解out输出参数
- 英特尔助力开立医疗推动超声产检智能化
- Wechat Online Education video on Demand Learning of applet Graduation Design (3) Background Function
- [super cloud terminal to create a leading opportunity] local computing cloud management, Intel helps digitalize Education
- 小程序毕设作品之微信在线教育视频点播学习小程序毕业设计(1)开发概要
- Buddy: initialize memory domain
- [database] must know and be able at the end of the term ----- Chapter 11 concurrency control
- About the problem of database, the concept of uniqueness and non repetition
猜你喜欢
In the era of super video, what is the solution to the data flood?
Skillfully use enterprise network disk to collect reports or summaries
Wechat e-book reading applet graduation design of applet completion works (3) background function
06 MAUI,WPF使用 MVVM Toolkit 框架 构建 MVVM 程序
机器学习11:代价敏感学习
图形验证码验证
可省近90%服务器,反欺诈效率却大增,PayPal打破「AI内存墙」的方案为何如此划算?
Wechat e-book reading applet graduation design of applet completion works (2) applet function
寻找数组的中心下标
如何更有效的过滤病毒/垃圾邮件!
随机推荐
Chapter 2 performance platform godeye source code analysis - data module
Some problems after xcode11 new project
PAC十年:见证HPC从CPU时代走向XPU纪元
Wechat e-book reading applet graduation design of applet completion works (2) applet function
Openresty 做静态资源服务器
minimum spanning tree
机器学习09:无监督学习
无心剑汉英双语诗005.《抒怀》
[database] must know and be able at the end of the term ----- Chapter 11 concurrency control
机器学习10:集成学习
Eas (energy aware scheduling) green energy-saving scheduler
小程序毕设作品之微信电子书阅读小程序毕业设计(8)毕业设计论文模板
项目套价是什么意思?
【数据库】期末必知必会-----第九章 数据库设计
leetcode209. 长度最小的子数组
AttributeError: ‘NoneType‘ object has no attribute ‘sort‘
巧用企业网盘收取报告或总结
结构体通过成员变量获取主结构体地址(struct)
Leetcode7 DFS + dynamic programming + double pointer
priority_ Introduction and use of queue