Instantly share code, notes, and snippets.

Embed
What would you like to do?
//
// ScreenView.swift
// Exported from Kite Compositor for Mac 1.7.6
//
// Created on 1/1/18, 3:45 PM.
//
import UIKit
class ScreenView: UIView
{
// MARK: - Properties
private var watchBackgroundLayer: CALayer?
private var innerBackgroundLayer: CALayer?
private var minuteMarkerLayer: CALayer?
private var hourMarkerLayer: CALayer?
private var leafLayer: CALayer?
private var stemLayer: CALayer?
private var minuteHandLayer: CALayer?
private var leafLayer1: CALayer?
private var stemLayer1: CALayer?
private var secondHandLayer: CALayer?
private var handLayer: CALayer?
private var centerPointLayer: CALayer?
private var shadeLayer: CALayer?
private var unnamedLayer: CATextLayer?
private var unnamedLayer1: CATextLayer?
private var unnamedLayer2: CATextLayer?
private var unnamedLayer3: CATextLayer?
private var unnamedLayer4: CATextLayer?
private var unnamedLayer5: CATextLayer?
private var unnamedLayer6: CATextLayer?
private var unnamedLayer7: CATextLayer?
private var unnamedLayer8: CATextLayer?
private var unnamedLayer9: CATextLayer?
private var unnamedLayer10: CATextLayer?
private var unnamedLayer11: CATextLayer?
private var whiteToBlackAnimation: CABasicAnimation?
private var scaleDownAnimation: CABasicAnimation?
private var scaleUpAnimation: CABasicAnimation?
private var opacityUpAnimation: CABasicAnimation?
private var opacityDownAnimation: CABasicAnimation?
private var boundsSizeAnimation: CABasicAnimation?
private var cornerradiusAnimation: CABasicAnimation?
private var transformScaleAnimation: CABasicAnimation?
private var transformScaleAnimation1: CABasicAnimation?
private var transformScaleAnimation2: CABasicAnimation?
private var transformScaleAnimation3: CABasicAnimation?
private var transformScaleAnimation4: CABasicAnimation?
private var transformScaleAnimation5: CABasicAnimation?
private var transformScaleAnimation6: CABasicAnimation?
private var transformScaleAnimation7: CABasicAnimation?
private var transformScaleAnimation8: CABasicAnimation?
private var transformScaleAnimation9: CABasicAnimation?
private var transformScaleAnimation10: CABasicAnimation?
private var transformScaleAnimation11: CABasicAnimation?
private var boundsSizeHeightAnimation: CABasicAnimation?
private var boundsSizeHeightAnimation1: CABasicAnimation?
private var backgroundcolorAnimation: CABasicAnimation?
private var boundsSizeWidthAnimation: CABasicAnimation?
private var cornerradiusAnimation1: CABasicAnimation?
private var backgroundcolorAnimation1: CABasicAnimation?
private var boundsSizeWidthAnimation1: CABasicAnimation?
private var shadowradiusAnimation: CABasicAnimation?
private var boundsSizeHeightAnimation2: CABasicAnimation?
private var backgroundcolorAnimation2: CABasicAnimation?
private var boundsSizeWidthAnimation2: CABasicAnimation?
private var cornerradiusAnimation2: CABasicAnimation?
private var backgroundcolorAnimation3: CABasicAnimation?
private var boundsSizeWidthAnimation3: CABasicAnimation?
private var backgroundcolorAnimation4: CABasicAnimation?
private var boundsSizeHeightAnimation3: CABasicAnimation?
private var shadowradiusAnimation1: CABasicAnimation?
private var transformScaleXAnimation: CABasicAnimation?
private var shadowopacityAnimation: CABasicAnimation?
private var backgroundcolorAnimation5: CABasicAnimation?
// MARK: - Initialization
init()
{
super.init(frame: CGRect(x: 0, y: 0, width: 312, height: 390))
self.setupLayers()
}
required init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
self.setupLayers()
}
// MARK: - Setup Layers
private func setupLayers()
{
// Colors
//
let backgroundcolor = UIColor.black
let backgroundcolor1 = UIColor.white
let bordercolor = UIColor(red: 0.0276, green: 0.92, blue: 0.689928, alpha: 0)
let bordercolor1 = UIColor(red: 0.619025, green: 0.88, blue: 0.2376, alpha: 0)
let backgroundcolor2 = UIColor(red: 0.402806, green: 0.0924, blue: 0.66, alpha: 0)
let bordercolor2 = UIColor(red: 0.524869, green: 0.1204, blue: 0.86, alpha: 0)
let backgroundcolor3 = UIColor(red: 0, green: 0, blue: 0, alpha: 0)
let bordercolor3 = UIColor(red: 0.795254, green: 0.795254, blue: 0.795254, alpha: 0)
let backgroundcolor4 = UIColor(red: 0.436137, green: 0.74, blue: 0.2072, alpha: 0)
let bordercolor4 = UIColor(red: 0.554012, green: 0.94, blue: 0.2632, alpha: 0)
let backgroundcolor5 = UIColor(red: 0.517647, green: 0.517647, blue: 0.517647, alpha: 1)
let bordercolor5 = UIColor(red: 0.0356, green: 0.89, blue: 0.44945, alpha: 0)
let backgroundcolor6 = UIColor(red: 0.501425, green: 0.1736, blue: 0.62, alpha: 0)
let bordercolor6 = UIColor(red: 0.663175, green: 0.2296, blue: 0.82, alpha: 0)
let bordercolor7 = UIColor(red: 0.0486, green: 0.185414, blue: 0.81, alpha: 0)
let backgroundcolor7 = UIColor(red: 0.0192, green: 0.64, blue: 0.5527, alpha: 0)
let bordercolor8 = UIColor(red: 0.0252, green: 0.84, blue: 0.725419, alpha: 0)
let bordercolor9 = UIColor(red: 0.183136, green: 0.1782, blue: 0.81, alpha: 0)
let color = UIColor(red: 1, green: 0.517647, blue: 0, alpha: 1)
let bordercolor10 = UIColor(red: 0.21069, green: 0.21069, blue: 0.21069, alpha: 1)
let bordercolor11 = UIColor(red: 0.886275, green: 0.180392, blue: 0.117647, alpha: 0)
let bordercolor12 = UIColor(red: 0.532125, green: 0.172, blue: 0.86, alpha: 0)
// Fonts
//
let systemFontMediumFont = UIFont.systemFont(ofSize: 150.0, weight: UIFontWeightMedium)
// Screen
//
let screenLayer = CALayer()
screenLayer.name = "Screen"
screenLayer.bounds = CGRect(x: 0, y: 0, width: 312, height: 390)
screenLayer.position = CGPoint(x: 0, y: 0)
screenLayer.anchorPoint = CGPoint(x: 0, y: 0)
screenLayer.contentsGravity = kCAGravityCenter
screenLayer.masksToBounds = true
screenLayer.backgroundColor = backgroundcolor.cgColor
screenLayer.shadowOffset = CGSize(width: 0, height: 1)
screenLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
// Screen Sublayers
//
// Watch Background
//
let watchBackgroundLayer = CALayer()
watchBackgroundLayer.name = "Watch Background"
watchBackgroundLayer.bounds = CGRect(x: 0, y: 0, width: 1054, height: 1054)
watchBackgroundLayer.position = CGPoint(x: 156, y: 195)
watchBackgroundLayer.anchorPoint = CGPoint(x: 0.5, y: 0.498114)
watchBackgroundLayer.contentsGravity = kCAGravityCenter
watchBackgroundLayer.backgroundColor = backgroundcolor1.cgColor
watchBackgroundLayer.cornerRadius = 527
watchBackgroundLayer.borderWidth = 1
watchBackgroundLayer.borderColor = bordercolor.cgColor
watchBackgroundLayer.shadowOffset = CGSize(width: 0, height: 1)
watchBackgroundLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
watchBackgroundLayer.transform = CATransform3D( m11: 0.0755, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 0.0755, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// Watch Background Animations
//
// White to Black
//
let whiteToBlackAnimation = CABasicAnimation()
whiteToBlackAnimation.beginTime = 0.000001
whiteToBlackAnimation.duration = 0.2
whiteToBlackAnimation.fillMode = kCAFillModeBoth
whiteToBlackAnimation.isRemovedOnCompletion = false
whiteToBlackAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
whiteToBlackAnimation.keyPath = "backgroundColor"
whiteToBlackAnimation.toValue = backgroundcolor.cgColor
whiteToBlackAnimation.fromValue = backgroundcolor1.cgColor
// Scale Down
//
// This animation is hidden
//
let scaleDownAnimation = CABasicAnimation()
scaleDownAnimation.beginTime = 0.000001
scaleDownAnimation.duration = 0.2
scaleDownAnimation.fillMode = kCAFillModeForwards
scaleDownAnimation.isRemovedOnCompletion = false
scaleDownAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
scaleDownAnimation.keyPath = "transform.scale"
scaleDownAnimation.toValue = 0.065
scaleDownAnimation.fromValue = 0.0755
// Scale Up
//
let scaleUpAnimation = CABasicAnimation()
scaleUpAnimation.beginTime = 0.000001
scaleUpAnimation.duration = 0.2
scaleUpAnimation.fillMode = kCAFillModeForwards
scaleUpAnimation.isRemovedOnCompletion = false
scaleUpAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
scaleUpAnimation.keyPath = "transform.scale"
scaleUpAnimation.toValue = 0.295
scaleUpAnimation.fromValue = 0.0755
// Watch Background Sublayers
//
// Shade
//
let shadeLayer = CALayer()
shadeLayer.name = "Shade"
shadeLayer.bounds = CGRect(x: 0, y: 0, width: 1054, height: 1054)
shadeLayer.position = CGPoint(x: 527, y: 527)
shadeLayer.contentsGravity = kCAGravityCenter
shadeLayer.opacity = 0
shadeLayer.backgroundColor = backgroundcolor.cgColor
shadeLayer.cornerRadius = 527
shadeLayer.borderColor = bordercolor1.cgColor
shadeLayer.shadowOffset = CGSize(width: 0, height: 1)
shadeLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
// Shade Animations
//
// Opacity Up
//
let opacityUpAnimation = CABasicAnimation()
opacityUpAnimation.beginTime = 0.000001
opacityUpAnimation.duration = 0.2
opacityUpAnimation.fillMode = kCAFillModeBoth
opacityUpAnimation.isRemovedOnCompletion = false
opacityUpAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
opacityUpAnimation.keyPath = "opacity"
opacityUpAnimation.toValue = 0.5
// Opacity Down
//
let opacityDownAnimation = CABasicAnimation()
opacityDownAnimation.beginTime = 0.000001
opacityDownAnimation.duration = 0.2
opacityDownAnimation.fillMode = kCAFillModeBoth
opacityDownAnimation.isRemovedOnCompletion = false
opacityDownAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
opacityDownAnimation.keyPath = "opacity"
opacityDownAnimation.toValue = 0
watchBackgroundLayer.addSublayer(shadeLayer)
// Inner Background
//
let innerBackgroundLayer = CALayer()
innerBackgroundLayer.name = "Inner Background"
innerBackgroundLayer.bounds = CGRect(x: 0, y: 0, width: 1054, height: 1054)
innerBackgroundLayer.position = CGPoint(x: 527, y: 527)
innerBackgroundLayer.contentsGravity = kCAGravityCenter
innerBackgroundLayer.backgroundColor = backgroundcolor.cgColor
innerBackgroundLayer.cornerRadius = 527
innerBackgroundLayer.borderColor = bordercolor1.cgColor
innerBackgroundLayer.shadowOffset = CGSize(width: 0, height: 1)
innerBackgroundLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
// Inner Background Animations
//
// bounds.size
//
let boundsSizeAnimation = CABasicAnimation()
boundsSizeAnimation.beginTime = 0.000001
boundsSizeAnimation.duration = 0.2
boundsSizeAnimation.fillMode = kCAFillModeBoth
boundsSizeAnimation.isRemovedOnCompletion = false
boundsSizeAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeAnimation.keyPath = "bounds.size"
boundsSizeAnimation.toValue = CGSize(width: 1054, height: 1054)
boundsSizeAnimation.fromValue = CGSize(width: 0, height: 0)
// cornerRadius
//
let cornerradiusAnimation = CABasicAnimation()
cornerradiusAnimation.beginTime = 0.000001
cornerradiusAnimation.duration = 0.2
cornerradiusAnimation.fillMode = kCAFillModeBoth
cornerradiusAnimation.isRemovedOnCompletion = false
cornerradiusAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
cornerradiusAnimation.keyPath = "cornerRadius"
cornerradiusAnimation.toValue = 527
cornerradiusAnimation.fromValue = 0
watchBackgroundLayer.addSublayer(innerBackgroundLayer)
// Numbers
//
let numbersLayer = CALayer()
numbersLayer.name = "Numbers"
numbersLayer.bounds = CGRect(x: 0, y: 0, width: 1054, height: 1054)
numbersLayer.position = CGPoint(x: 0, y: 0)
numbersLayer.anchorPoint = CGPoint(x: 0, y: 0)
numbersLayer.contentsGravity = kCAGravityCenter
numbersLayer.backgroundColor = backgroundcolor2.cgColor
numbersLayer.borderColor = bordercolor2.cgColor
numbersLayer.shadowOffset = CGSize(width: 0, height: 1)
numbersLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
// Numbers Sublayers
//
// 12
//
let unnamedLayer = CATextLayer()
unnamedLayer.name = "12"
unnamedLayer.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer.position = CGPoint(x: 531.983035, y: 145.142928)
unnamedLayer.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer.contentsGravity = kCAGravityCenter
unnamedLayer.contentsScale = 2
unnamedLayer.backgroundColor = backgroundcolor3.cgColor
unnamedLayer.borderColor = bordercolor3.cgColor
unnamedLayer.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer.needsDisplayOnBoundsChange = true
unnamedLayer.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 12 Animations
//
// transform.scale
//
let transformScaleAnimation = CABasicAnimation()
transformScaleAnimation.beginTime = 0.2
transformScaleAnimation.duration = 0.02
transformScaleAnimation.fillMode = kCAFillModeBoth
transformScaleAnimation.isRemovedOnCompletion = false
transformScaleAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation.keyPath = "transform.scale"
transformScaleAnimation.toValue = 1
transformScaleAnimation.fromValue = 0
// 12 Attributed String
//
let unnamedAttributedString = NSMutableAttributedString(string: "12")
unnamedAttributedString.setAttributes([NSForegroundColorAttributeName: backgroundcolor1, NSKernAttributeName: -5.5, NSFontAttributeName: systemFontMediumFont], range: NSRange(location: 0, length: 2))
unnamedLayer.string = unnamedAttributedString
unnamedLayer.isWrapped = true
unnamedLayer.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer)
// 1
//
let unnamedLayer1 = CATextLayer()
unnamedLayer1.name = "1"
unnamedLayer1.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer1.position = CGPoint(x: 738.630035, y: 196.142928)
unnamedLayer1.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer1.contentsGravity = kCAGravityCenter
unnamedLayer1.contentsScale = 2
unnamedLayer1.backgroundColor = backgroundcolor3.cgColor
unnamedLayer1.borderColor = bordercolor3.cgColor
unnamedLayer1.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer1.needsDisplayOnBoundsChange = true
unnamedLayer1.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 1 Animations
//
// transform.scale
//
let transformScaleAnimation1 = CABasicAnimation()
transformScaleAnimation1.beginTime = 0.2067
transformScaleAnimation1.duration = 0.02
transformScaleAnimation1.fillMode = kCAFillModeBoth
transformScaleAnimation1.isRemovedOnCompletion = false
transformScaleAnimation1.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation1.keyPath = "transform.scale"
transformScaleAnimation1.toValue = 1
transformScaleAnimation1.fromValue = 0
unnamedLayer1.string = "1"
unnamedLayer1.fontSize = 150
unnamedLayer1.foregroundColor = backgroundcolor1.cgColor
unnamedLayer1.font = systemFontMediumFont
unnamedLayer1.isWrapped = true
unnamedLayer1.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer1)
// 2
//
let unnamedLayer2 = CATextLayer()
unnamedLayer2.name = "2"
unnamedLayer2.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer2.position = CGPoint(x: 891.630035, y: 342)
unnamedLayer2.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer2.contentsGravity = kCAGravityCenter
unnamedLayer2.contentsScale = 2
unnamedLayer2.backgroundColor = backgroundcolor3.cgColor
unnamedLayer2.borderColor = bordercolor3.cgColor
unnamedLayer2.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer2.needsDisplayOnBoundsChange = true
unnamedLayer2.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 2 Animations
//
// transform.scale
//
let transformScaleAnimation2 = CABasicAnimation()
transformScaleAnimation2.beginTime = 0.2257
transformScaleAnimation2.duration = 0.02
transformScaleAnimation2.fillMode = kCAFillModeBoth
transformScaleAnimation2.isRemovedOnCompletion = false
transformScaleAnimation2.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation2.keyPath = "transform.scale"
transformScaleAnimation2.toValue = 1
transformScaleAnimation2.fromValue = 0
unnamedLayer2.string = "2"
unnamedLayer2.fontSize = 150
unnamedLayer2.foregroundColor = backgroundcolor1.cgColor
unnamedLayer2.font = systemFontMediumFont
unnamedLayer2.isWrapped = true
unnamedLayer2.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer2)
// 3
//
let unnamedLayer3 = CATextLayer()
unnamedLayer3.name = "3"
unnamedLayer3.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer3.position = CGPoint(x: 936, y: 529)
unnamedLayer3.anchorPoint = CGPoint(x: 0.5, y: 0.585234)
unnamedLayer3.contentsGravity = kCAGravityCenter
unnamedLayer3.contentsScale = 2
unnamedLayer3.backgroundColor = backgroundcolor3.cgColor
unnamedLayer3.borderColor = bordercolor3.cgColor
unnamedLayer3.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer3.needsDisplayOnBoundsChange = true
unnamedLayer3.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 3 Animations
//
// transform.scale
//
let transformScaleAnimation3 = CABasicAnimation()
transformScaleAnimation3.beginTime = 0.2438
transformScaleAnimation3.duration = 0.02
transformScaleAnimation3.fillMode = kCAFillModeBoth
transformScaleAnimation3.isRemovedOnCompletion = false
transformScaleAnimation3.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation3.keyPath = "transform.scale"
transformScaleAnimation3.toValue = 1
transformScaleAnimation3.fromValue = 0
unnamedLayer3.string = "3"
unnamedLayer3.fontSize = 150
unnamedLayer3.foregroundColor = backgroundcolor1.cgColor
unnamedLayer3.font = systemFontMediumFont
unnamedLayer3.isWrapped = true
unnamedLayer3.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer3)
// 4
//
let unnamedLayer4 = CATextLayer()
unnamedLayer4.name = "4"
unnamedLayer4.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer4.position = CGPoint(x: 872.630035, y: 729.5125)
unnamedLayer4.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer4.contentsGravity = kCAGravityCenter
unnamedLayer4.contentsScale = 2
unnamedLayer4.backgroundColor = backgroundcolor3.cgColor
unnamedLayer4.borderColor = bordercolor3.cgColor
unnamedLayer4.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer4.needsDisplayOnBoundsChange = true
unnamedLayer4.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 4 Animations
//
// transform.scale
//
let transformScaleAnimation4 = CABasicAnimation()
transformScaleAnimation4.beginTime = 0.2581
transformScaleAnimation4.duration = 0.02
transformScaleAnimation4.fillMode = kCAFillModeBoth
transformScaleAnimation4.isRemovedOnCompletion = false
transformScaleAnimation4.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation4.keyPath = "transform.scale"
transformScaleAnimation4.toValue = 1
transformScaleAnimation4.fromValue = 0
unnamedLayer4.string = "4"
unnamedLayer4.fontSize = 150
unnamedLayer4.foregroundColor = backgroundcolor1.cgColor
unnamedLayer4.font = systemFontMediumFont
unnamedLayer4.isWrapped = true
unnamedLayer4.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer4)
// 5
//
let unnamedLayer5 = CATextLayer()
unnamedLayer5.name = "5"
unnamedLayer5.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer5.position = CGPoint(x: 737.630035, y: 866.5125)
unnamedLayer5.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer5.contentsGravity = kCAGravityCenter
unnamedLayer5.contentsScale = 2
unnamedLayer5.backgroundColor = backgroundcolor3.cgColor
unnamedLayer5.borderColor = bordercolor3.cgColor
unnamedLayer5.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer5.needsDisplayOnBoundsChange = true
unnamedLayer5.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 5 Animations
//
// transform.scale
//
let transformScaleAnimation5 = CABasicAnimation()
transformScaleAnimation5.beginTime = 0.2778
transformScaleAnimation5.duration = 0.02
transformScaleAnimation5.fillMode = kCAFillModeBoth
transformScaleAnimation5.isRemovedOnCompletion = false
transformScaleAnimation5.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation5.keyPath = "transform.scale"
transformScaleAnimation5.toValue = 1
transformScaleAnimation5.fromValue = 0
unnamedLayer5.string = "5"
unnamedLayer5.fontSize = 150
unnamedLayer5.foregroundColor = backgroundcolor1.cgColor
unnamedLayer5.font = systemFontMediumFont
unnamedLayer5.isWrapped = true
unnamedLayer5.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer5)
// 6
//
let unnamedLayer6 = CATextLayer()
unnamedLayer6.name = "6"
unnamedLayer6.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer6.position = CGPoint(x: 533.623932, y: 920.5125)
unnamedLayer6.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer6.contentsGravity = kCAGravityCenter
unnamedLayer6.contentsScale = 2
unnamedLayer6.backgroundColor = backgroundcolor3.cgColor
unnamedLayer6.borderColor = bordercolor3.cgColor
unnamedLayer6.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer6.needsDisplayOnBoundsChange = true
unnamedLayer6.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 6 Animations
//
// transform.scale
//
let transformScaleAnimation6 = CABasicAnimation()
transformScaleAnimation6.beginTime = 0.29
transformScaleAnimation6.duration = 0.02
transformScaleAnimation6.fillMode = kCAFillModeBoth
transformScaleAnimation6.isRemovedOnCompletion = false
transformScaleAnimation6.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation6.keyPath = "transform.scale"
transformScaleAnimation6.toValue = 1
transformScaleAnimation6.fromValue = 0
unnamedLayer6.string = "6"
unnamedLayer6.fontSize = 150
unnamedLayer6.foregroundColor = backgroundcolor1.cgColor
unnamedLayer6.font = systemFontMediumFont
unnamedLayer6.isWrapped = true
unnamedLayer6.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer6)
// 7
//
let unnamedLayer7 = CATextLayer()
unnamedLayer7.name = "7"
unnamedLayer7.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer7.position = CGPoint(x: 337.630035, y: 866.5125)
unnamedLayer7.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer7.contentsGravity = kCAGravityCenter
unnamedLayer7.contentsScale = 2
unnamedLayer7.backgroundColor = backgroundcolor3.cgColor
unnamedLayer7.borderColor = bordercolor3.cgColor
unnamedLayer7.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer7.needsDisplayOnBoundsChange = true
unnamedLayer7.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 7 Animations
//
// transform.scale
//
let transformScaleAnimation7 = CABasicAnimation()
transformScaleAnimation7.beginTime = 0.3054
transformScaleAnimation7.duration = 0.02
transformScaleAnimation7.fillMode = kCAFillModeBoth
transformScaleAnimation7.isRemovedOnCompletion = false
transformScaleAnimation7.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation7.keyPath = "transform.scale"
transformScaleAnimation7.toValue = 1
transformScaleAnimation7.fromValue = 0
unnamedLayer7.string = "7"
unnamedLayer7.fontSize = 150
unnamedLayer7.foregroundColor = backgroundcolor1.cgColor
unnamedLayer7.font = systemFontMediumFont
unnamedLayer7.isWrapped = true
unnamedLayer7.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer7)
// 8
//
let unnamedLayer8 = CATextLayer()
unnamedLayer8.name = "8"
unnamedLayer8.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer8.position = CGPoint(x: 190.630035, y: 729.5125)
unnamedLayer8.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer8.contentsGravity = kCAGravityCenter
unnamedLayer8.contentsScale = 2
unnamedLayer8.backgroundColor = backgroundcolor3.cgColor
unnamedLayer8.borderColor = bordercolor3.cgColor
unnamedLayer8.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer8.needsDisplayOnBoundsChange = true
unnamedLayer8.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 8 Animations
//
// transform.scale
//
let transformScaleAnimation8 = CABasicAnimation()
transformScaleAnimation8.beginTime = 0.3224
transformScaleAnimation8.duration = 0.02
transformScaleAnimation8.fillMode = kCAFillModeBoth
transformScaleAnimation8.isRemovedOnCompletion = false
transformScaleAnimation8.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation8.keyPath = "transform.scale"
transformScaleAnimation8.toValue = 1
transformScaleAnimation8.fromValue = 0
unnamedLayer8.string = "8"
unnamedLayer8.fontSize = 150
unnamedLayer8.foregroundColor = backgroundcolor1.cgColor
unnamedLayer8.font = systemFontMediumFont
unnamedLayer8.isWrapped = true
unnamedLayer8.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer8)
// 9
//
let unnamedLayer9 = CATextLayer()
unnamedLayer9.name = "9"
unnamedLayer9.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer9.position = CGPoint(x: 131.630035, y: 536)
unnamedLayer9.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer9.contentsGravity = kCAGravityCenter
unnamedLayer9.contentsScale = 2
unnamedLayer9.backgroundColor = backgroundcolor3.cgColor
unnamedLayer9.borderColor = bordercolor3.cgColor
unnamedLayer9.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer9.needsDisplayOnBoundsChange = true
unnamedLayer9.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 9 Animations
//
// transform.scale
//
let transformScaleAnimation9 = CABasicAnimation()
transformScaleAnimation9.beginTime = 0.3388
transformScaleAnimation9.duration = 0.02
transformScaleAnimation9.fillMode = kCAFillModeBoth
transformScaleAnimation9.isRemovedOnCompletion = false
transformScaleAnimation9.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation9.keyPath = "transform.scale"
transformScaleAnimation9.toValue = 1
transformScaleAnimation9.fromValue = 0
unnamedLayer9.string = "9"
unnamedLayer9.fontSize = 150
unnamedLayer9.foregroundColor = backgroundcolor1.cgColor
unnamedLayer9.font = systemFontMediumFont
unnamedLayer9.isWrapped = true
unnamedLayer9.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer9)
// 10
//
let unnamedLayer10 = CATextLayer()
unnamedLayer10.name = "10"
unnamedLayer10.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer10.position = CGPoint(x: 208.630035, y: 343.142928)
unnamedLayer10.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer10.contentsGravity = kCAGravityCenter
unnamedLayer10.contentsScale = 2
unnamedLayer10.backgroundColor = backgroundcolor3.cgColor
unnamedLayer10.borderColor = bordercolor3.cgColor
unnamedLayer10.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer10.needsDisplayOnBoundsChange = true
unnamedLayer10.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 10 Animations
//
// transform.scale
//
let transformScaleAnimation10 = CABasicAnimation()
transformScaleAnimation10.beginTime = 0.3555
transformScaleAnimation10.duration = 0.02
transformScaleAnimation10.fillMode = kCAFillModeBoth
transformScaleAnimation10.isRemovedOnCompletion = false
transformScaleAnimation10.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation10.keyPath = "transform.scale"
transformScaleAnimation10.toValue = 1
transformScaleAnimation10.fromValue = 0
// 10 Attributed String
//
let unnamedAttributedString1 = NSMutableAttributedString(string: "10")
unnamedAttributedString1.setAttributes([NSForegroundColorAttributeName: backgroundcolor1, NSKernAttributeName: -5.5, NSFontAttributeName: systemFontMediumFont], range: NSRange(location: 0, length: 2))
unnamedLayer10.string = unnamedAttributedString1
unnamedLayer10.isWrapped = true
unnamedLayer10.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer10)
// 11
//
let unnamedLayer11 = CATextLayer()
unnamedLayer11.name = "11"
unnamedLayer11.bounds = CGRect(x: 0, y: 0, width: 160, height: 160)
unnamedLayer11.position = CGPoint(x: 348.630035, y: 196.142928)
unnamedLayer11.anchorPoint = CGPoint(x: 0.528938, y: 0.63125)
unnamedLayer11.contentsGravity = kCAGravityCenter
unnamedLayer11.contentsScale = 2
unnamedLayer11.backgroundColor = backgroundcolor3.cgColor
unnamedLayer11.borderColor = bordercolor3.cgColor
unnamedLayer11.shadowOffset = CGSize(width: 0, height: 1)
unnamedLayer11.needsDisplayOnBoundsChange = true
unnamedLayer11.sublayerTransform = CATransform3D( m11: 0.166667, m12: 0, m13: 0, m14: 0,
m21: 0, m22: 1, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// 11 Animations
//
// transform.scale
//
let transformScaleAnimation11 = CABasicAnimation()
transformScaleAnimation11.beginTime = 0.3735
transformScaleAnimation11.duration = 0.02
transformScaleAnimation11.fillMode = kCAFillModeBoth
transformScaleAnimation11.isRemovedOnCompletion = false
transformScaleAnimation11.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transformScaleAnimation11.keyPath = "transform.scale"
transformScaleAnimation11.toValue = 1
transformScaleAnimation11.fromValue = 0
// 11 Attributed String
//
let unnamedAttributedString2 = NSMutableAttributedString(string: "11")
unnamedAttributedString2.setAttributes([NSForegroundColorAttributeName: backgroundcolor1, NSKernAttributeName: -5.5, NSFontAttributeName: systemFontMediumFont], range: NSRange(location: 0, length: 2))
unnamedLayer11.string = unnamedAttributedString2
unnamedLayer11.isWrapped = true
unnamedLayer11.alignmentMode = kCAAlignmentCenter
numbersLayer.addSublayer(unnamedLayer11)
watchBackgroundLayer.addSublayer(numbersLayer)
// Minute Markers
//
let minuteMarkersLayer = CAReplicatorLayer()
minuteMarkersLayer.name = "Minute Markers"
minuteMarkersLayer.bounds = CGRect(x: 0, y: 0, width: 1054, height: 1054)
minuteMarkersLayer.position = CGPoint(x: 0, y: 0)
minuteMarkersLayer.anchorPoint = CGPoint(x: 0, y: 0)
minuteMarkersLayer.contentsGravity = kCAGravityCenter
minuteMarkersLayer.backgroundColor = backgroundcolor4.cgColor
minuteMarkersLayer.borderWidth = 1
minuteMarkersLayer.borderColor = bordercolor4.cgColor
minuteMarkersLayer.shadowOffset = CGSize(width: 0, height: 1)
minuteMarkersLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
// Minute Markers Sublayers
//
// Minute Marker
//
let minuteMarkerLayer = CALayer()
minuteMarkerLayer.name = "Minute Marker"
minuteMarkerLayer.bounds = CGRect(x: 0, y: 0, width: 4, height: 33)
minuteMarkerLayer.position = CGPoint(x: 525, y: 8)
minuteMarkerLayer.anchorPoint = CGPoint(x: 0, y: 0)
minuteMarkerLayer.contentsGravity = kCAGravityCenter
minuteMarkerLayer.backgroundColor = backgroundcolor5.cgColor
minuteMarkerLayer.borderWidth = 1
minuteMarkerLayer.borderColor = bordercolor5.cgColor
minuteMarkerLayer.shadowOffset = CGSize(width: 0, height: 1)
// Minute Marker Animations
//
// bounds.size.height
//
let boundsSizeHeightAnimation = CABasicAnimation()
boundsSizeHeightAnimation.beginTime = 0.2
boundsSizeHeightAnimation.duration = 0.010571
boundsSizeHeightAnimation.fillMode = kCAFillModeBoth
boundsSizeHeightAnimation.isRemovedOnCompletion = false
boundsSizeHeightAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeHeightAnimation.keyPath = "bounds.size.height"
boundsSizeHeightAnimation.toValue = 33
boundsSizeHeightAnimation.fromValue = 0
minuteMarkersLayer.addSublayer(minuteMarkerLayer)
minuteMarkersLayer.instanceCount = 60
minuteMarkersLayer.instanceDelay = 0.0034
minuteMarkersLayer.instanceTransform = CATransform3D( m11: 0.994493, m12: 0.104807, m13: 0, m14: 0,
m21: -0.104807, m22: 0.994493, m23: 0, m24: 0,
m31: -0, m32: 0, m33: 1, m34: 0,
m41: 58.083, m42: -52.539001, m43: 0, m44: 1 )
watchBackgroundLayer.addSublayer(minuteMarkersLayer)
// Hour Markers
//
let hourMarkersLayer = CAReplicatorLayer()
hourMarkersLayer.name = "Hour Markers"
hourMarkersLayer.bounds = CGRect(x: 0, y: 0, width: 1054, height: 1054)
hourMarkersLayer.position = CGPoint(x: 0, y: 0)
hourMarkersLayer.anchorPoint = CGPoint(x: 0, y: 0)
hourMarkersLayer.contentsGravity = kCAGravityCenter
hourMarkersLayer.backgroundColor = backgroundcolor4.cgColor
hourMarkersLayer.borderWidth = 1
hourMarkersLayer.borderColor = bordercolor4.cgColor
hourMarkersLayer.shadowOffset = CGSize(width: 0, height: 1)
hourMarkersLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
// Hour Markers Sublayers
//
// Hour Marker
//
let hourMarkerLayer = CALayer()
hourMarkerLayer.name = "Hour Marker"
hourMarkerLayer.bounds = CGRect(x: 0, y: 0, width: 16, height: 39)
hourMarkerLayer.position = CGPoint(x: 518.993897, y: 2)
hourMarkerLayer.anchorPoint = CGPoint(x: 0, y: 0)
hourMarkerLayer.contentsGravity = kCAGravityCenter
hourMarkerLayer.backgroundColor = backgroundcolor1.cgColor
hourMarkerLayer.borderWidth = 1
hourMarkerLayer.borderColor = bordercolor5.cgColor
hourMarkerLayer.shadowOffset = CGSize(width: 0, height: 1)
// Hour Marker Animations
//
// bounds.size.height
//
let boundsSizeHeightAnimation1 = CABasicAnimation()
boundsSizeHeightAnimation1.beginTime = 0.2
boundsSizeHeightAnimation1.duration = 0.010571
boundsSizeHeightAnimation1.fillMode = kCAFillModeBoth
boundsSizeHeightAnimation1.isRemovedOnCompletion = false
boundsSizeHeightAnimation1.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeHeightAnimation1.keyPath = "bounds.size.height"
boundsSizeHeightAnimation1.toValue = 39
boundsSizeHeightAnimation1.fromValue = 0
hourMarkersLayer.addSublayer(hourMarkerLayer)
hourMarkersLayer.instanceCount = 12
hourMarkersLayer.instanceDelay = 0.017
hourMarkersLayer.instanceTransform = CATransform3D( m11: 0.865825, m12: 0.500347, m13: 0, m14: 0,
m21: -0.500347, m22: 0.865825, m23: 0, m24: 0,
m31: -0, m32: 0, m33: 1, m34: 0,
m41: 332.5, m42: -193, m43: 0, m44: 1 )
watchBackgroundLayer.addSublayer(hourMarkersLayer)
// Hour Hand
//
let hourHandLayer = CALayer()
hourHandLayer.name = "Hour Hand"
hourHandLayer.bounds = CGRect(x: 0, y: 0, width: 40.000019, height: 278.867451)
hourHandLayer.position = CGPoint(x: 527.153, y: 524.3125)
hourHandLayer.anchorPoint = CGPoint(x: 0.5, y: 1)
hourHandLayer.contentsGravity = kCAGravityCenter
hourHandLayer.backgroundColor = backgroundcolor6.cgColor
hourHandLayer.borderColor = bordercolor6.cgColor
hourHandLayer.shadowOffset = CGSize(width: 0, height: 1)
hourHandLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
hourHandLayer.transform = CATransform3D( m11: 0.494793, m12: -0.869011, m13: 0, m14: 0,
m21: 0.869011, m22: 0.494793, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// Hour Hand Sublayers
//
// Leaf
//
let leafLayer = CALayer()
leafLayer.name = "Leaf"
leafLayer.bounds = CGRect(x: 0, y: 0, width: 40, height: 217)
leafLayer.position = CGPoint(x: 20.000009, y: 217.000102)
leafLayer.anchorPoint = CGPoint(x: 0.5, y: 1)
leafLayer.contentsGravity = kCAGravityCenter
leafLayer.backgroundColor = backgroundcolor1.cgColor
leafLayer.cornerRadius = 20
leafLayer.borderColor = bordercolor7.cgColor
leafLayer.shadowOffset = CGSize(width: 0, height: 1)
// Leaf Animations
//
// backgroundColor
//
let backgroundcolorAnimation = CABasicAnimation()
backgroundcolorAnimation.beginTime = 0.000001
backgroundcolorAnimation.duration = 0.2
backgroundcolorAnimation.fillMode = kCAFillModeBoth
backgroundcolorAnimation.isRemovedOnCompletion = false
backgroundcolorAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
backgroundcolorAnimation.keyPath = "backgroundColor"
backgroundcolorAnimation.toValue = backgroundcolor1.cgColor
backgroundcolorAnimation.fromValue = backgroundcolor.cgColor
// bounds.size.width
//
let boundsSizeWidthAnimation = CABasicAnimation()
boundsSizeWidthAnimation.beginTime = 0.000001
boundsSizeWidthAnimation.duration = 0.2
boundsSizeWidthAnimation.fillMode = kCAFillModeBoth
boundsSizeWidthAnimation.isRemovedOnCompletion = false
boundsSizeWidthAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeWidthAnimation.keyPath = "bounds.size.width"
boundsSizeWidthAnimation.toValue = 50
boundsSizeWidthAnimation.fromValue = 55
// cornerRadius
//
let cornerradiusAnimation1 = CABasicAnimation()
cornerradiusAnimation1.beginTime = 0.000001
cornerradiusAnimation1.duration = 0.2
cornerradiusAnimation1.fillMode = kCAFillModeBoth
cornerradiusAnimation1.isRemovedOnCompletion = false
cornerradiusAnimation1.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
cornerradiusAnimation1.keyPath = "cornerRadius"
cornerradiusAnimation1.toValue = 20
cornerradiusAnimation1.fromValue = 30
hourHandLayer.addSublayer(leafLayer)
// Stem
//
let stemLayer = CALayer()
stemLayer.name = "Stem"
stemLayer.bounds = CGRect(x: 0, y: 0, width: 16, height: 66)
stemLayer.position = CGPoint(x: 20.000009, y: 278.869703)
stemLayer.anchorPoint = CGPoint(x: 0.5, y: 1)
stemLayer.contentsGravity = kCAGravityCenter
stemLayer.backgroundColor = backgroundcolor1.cgColor
stemLayer.shadowOffset = CGSize(width: 0, height: 1)
// Stem Animations
//
// backgroundColor
//
let backgroundcolorAnimation1 = CABasicAnimation()
backgroundcolorAnimation1.beginTime = 0.000001
backgroundcolorAnimation1.duration = 0.2
backgroundcolorAnimation1.fillMode = kCAFillModeBoth
backgroundcolorAnimation1.isRemovedOnCompletion = false
backgroundcolorAnimation1.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
backgroundcolorAnimation1.keyPath = "backgroundColor"
backgroundcolorAnimation1.toValue = backgroundcolor1.cgColor
backgroundcolorAnimation1.fromValue = backgroundcolor.cgColor
// bounds.size.width
//
let boundsSizeWidthAnimation1 = CABasicAnimation()
boundsSizeWidthAnimation1.beginTime = 0.000001
boundsSizeWidthAnimation1.duration = 0.2
boundsSizeWidthAnimation1.fillMode = kCAFillModeBoth
boundsSizeWidthAnimation1.isRemovedOnCompletion = false
boundsSizeWidthAnimation1.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeWidthAnimation1.keyPath = "bounds.size.width"
boundsSizeWidthAnimation1.toValue = 16
boundsSizeWidthAnimation1.fromValue = 25
hourHandLayer.addSublayer(stemLayer)
watchBackgroundLayer.addSublayer(hourHandLayer)
// Minute Hand
//
let minuteHandLayer = CALayer()
minuteHandLayer.name = "Minute Hand"
minuteHandLayer.bounds = CGRect(x: 0, y: 0, width: 50, height: 484)
minuteHandLayer.position = CGPoint(x: 527, y: 525.0125)
minuteHandLayer.anchorPoint = CGPoint(x: 0.5, y: 1)
minuteHandLayer.contentsGravity = kCAGravityCenter
minuteHandLayer.backgroundColor = backgroundcolor7.cgColor
minuteHandLayer.borderWidth = 1
minuteHandLayer.borderColor = bordercolor8.cgColor
minuteHandLayer.shadowOpacity = 1
minuteHandLayer.shadowRadius = 14
minuteHandLayer.shadowOffset = CGSize(width: 0, height: 1)
minuteHandLayer.minificationFilterBias = 1
minuteHandLayer.edgeAntialiasingMask = CAEdgeAntialiasingMask()
minuteHandLayer.transform = CATransform3D( m11: 0.585743, m12: 0.810497, m13: 0, m14: 0,
m21: -0.810497, m22: 0.585743, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// Minute Hand Animations
//
// shadowRadius
//
let shadowradiusAnimation = CABasicAnimation()
shadowradiusAnimation.beginTime = 0.000001
shadowradiusAnimation.duration = 0.2
shadowradiusAnimation.fillMode = kCAFillModeBoth
shadowradiusAnimation.isRemovedOnCompletion = false
shadowradiusAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
shadowradiusAnimation.keyPath = "shadowRadius"
shadowradiusAnimation.toValue = 14
shadowradiusAnimation.fromValue = 0
// Minute Hand Sublayers
//
// Leaf
//
let leafLayer1 = CALayer()
leafLayer1.name = "Leaf"
leafLayer1.bounds = CGRect(x: 0, y: 0, width: 50, height: 423)
leafLayer1.position = CGPoint(x: 25, y: 422.999993)
leafLayer1.anchorPoint = CGPoint(x: 0.5, y: 1)
leafLayer1.contentsGravity = kCAGravityCenter
leafLayer1.backgroundColor = backgroundcolor1.cgColor
leafLayer1.cornerRadius = 20
leafLayer1.borderColor = bordercolor7.cgColor
leafLayer1.shadowRadius = 0
leafLayer1.shadowOffset = CGSize(width: 0, height: 0)
// Leaf Animations
//
// bounds.size.height
//
let boundsSizeHeightAnimation2 = CABasicAnimation()
boundsSizeHeightAnimation2.beginTime = 0.000001
boundsSizeHeightAnimation2.duration = 0.2
boundsSizeHeightAnimation2.fillMode = kCAFillModeBoth
boundsSizeHeightAnimation2.isRemovedOnCompletion = false
boundsSizeHeightAnimation2.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeHeightAnimation2.keyPath = "bounds.size.height"
boundsSizeHeightAnimation2.toValue = 423
boundsSizeHeightAnimation2.fromValue = 404
// backgroundColor
//
let backgroundcolorAnimation2 = CABasicAnimation()
backgroundcolorAnimation2.beginTime = 0.000001
backgroundcolorAnimation2.duration = 0.2
backgroundcolorAnimation2.fillMode = kCAFillModeBoth
backgroundcolorAnimation2.isRemovedOnCompletion = false
backgroundcolorAnimation2.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
backgroundcolorAnimation2.keyPath = "backgroundColor"
backgroundcolorAnimation2.toValue = backgroundcolor1.cgColor
backgroundcolorAnimation2.fromValue = backgroundcolor.cgColor
// bounds.size.width
//
let boundsSizeWidthAnimation2 = CABasicAnimation()
boundsSizeWidthAnimation2.beginTime = 0.000001
boundsSizeWidthAnimation2.duration = 0.2
boundsSizeWidthAnimation2.fillMode = kCAFillModeBoth
boundsSizeWidthAnimation2.isRemovedOnCompletion = false
boundsSizeWidthAnimation2.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeWidthAnimation2.keyPath = "bounds.size.width"
boundsSizeWidthAnimation2.toValue = 50
boundsSizeWidthAnimation2.fromValue = 55
// cornerRadius
//
let cornerradiusAnimation2 = CABasicAnimation()
cornerradiusAnimation2.beginTime = 0.000001
cornerradiusAnimation2.duration = 0.2
cornerradiusAnimation2.fillMode = kCAFillModeBoth
cornerradiusAnimation2.isRemovedOnCompletion = false
cornerradiusAnimation2.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
cornerradiusAnimation2.keyPath = "cornerRadius"
cornerradiusAnimation2.toValue = 20
cornerradiusAnimation2.fromValue = 30
minuteHandLayer.addSublayer(leafLayer1)
// Stem
//
let stemLayer1 = CALayer()
stemLayer1.name = "Stem"
stemLayer1.bounds = CGRect(x: 0, y: 0, width: 16, height: 66)
stemLayer1.position = CGPoint(x: 25, y: 484)
stemLayer1.anchorPoint = CGPoint(x: 0.5, y: 1)
stemLayer1.contentsGravity = kCAGravityCenter
stemLayer1.backgroundColor = backgroundcolor1.cgColor
stemLayer1.shadowRadius = 0
stemLayer1.shadowOffset = CGSize(width: 0, height: 0)
// Stem Animations
//
// backgroundColor
//
let backgroundcolorAnimation3 = CABasicAnimation()
backgroundcolorAnimation3.beginTime = 0.000001
backgroundcolorAnimation3.duration = 0.2
backgroundcolorAnimation3.fillMode = kCAFillModeBoth
backgroundcolorAnimation3.isRemovedOnCompletion = false
backgroundcolorAnimation3.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
backgroundcolorAnimation3.keyPath = "backgroundColor"
backgroundcolorAnimation3.toValue = backgroundcolor1.cgColor
backgroundcolorAnimation3.fromValue = backgroundcolor.cgColor
// bounds.size.width
//
let boundsSizeWidthAnimation3 = CABasicAnimation()
boundsSizeWidthAnimation3.beginTime = 0.000001
boundsSizeWidthAnimation3.duration = 0.2
boundsSizeWidthAnimation3.fillMode = kCAFillModeBoth
boundsSizeWidthAnimation3.isRemovedOnCompletion = false
boundsSizeWidthAnimation3.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeWidthAnimation3.keyPath = "bounds.size.width"
boundsSizeWidthAnimation3.toValue = 16
boundsSizeWidthAnimation3.fromValue = 25
minuteHandLayer.addSublayer(stemLayer1)
watchBackgroundLayer.addSublayer(minuteHandLayer)
// Second Hand
//
let secondHandLayer = CALayer()
secondHandLayer.name = "Second Hand"
secondHandLayer.bounds = CGRect(x: 0, y: 0, width: 48, height: 48)
secondHandLayer.position = CGPoint(x: 526.983035, y: 525.0125)
secondHandLayer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
secondHandLayer.contentsGravity = kCAGravityCenter
secondHandLayer.backgroundColor = backgroundcolor1.cgColor
secondHandLayer.cornerRadius = 24
secondHandLayer.borderColor = bordercolor9.cgColor
secondHandLayer.shadowOffset = CGSize(width: 0, height: 1)
secondHandLayer.transform = CATransform3D( m11: 0.965566, m12: -0.260157, m13: 0, m14: 0,
m21: 0.260157, m22: 0.965566, m23: 0, m24: 0,
m31: 0, m32: 0, m33: 1, m34: 0,
m41: 0, m42: 0, m43: 0, m44: 1 )
// Second Hand Animations
//
// Second Tick
//
let secondTickAnimation = CABasicAnimation()
secondTickAnimation.beginTime = self.layer.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
secondTickAnimation.duration = 60
secondTickAnimation.repeatCount = 100
secondTickAnimation.fillMode = kCAFillModeForwards
secondTickAnimation.isRemovedOnCompletion = false
secondTickAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
secondTickAnimation.keyPath = "transform.rotation.z"
secondTickAnimation.toValue = 6.02
secondTickAnimation.fromValue = -0.2631853071795869
secondHandLayer.add(secondTickAnimation, forKey: "secondTickAnimation")
// backgroundColor
//
let backgroundcolorAnimation4 = CABasicAnimation()
backgroundcolorAnimation4.beginTime = 0.000001
backgroundcolorAnimation4.duration = 0.2
backgroundcolorAnimation4.fillMode = kCAFillModeBoth
backgroundcolorAnimation4.isRemovedOnCompletion = false
backgroundcolorAnimation4.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
backgroundcolorAnimation4.keyPath = "backgroundColor"
backgroundcolorAnimation4.toValue = backgroundcolor1.cgColor
backgroundcolorAnimation4.fromValue = color.cgColor
// Second Hand Sublayers
//
// Hand
//
let handLayer = CALayer()
handLayer.name = "Hand"
handLayer.bounds = CGRect(x: 0, y: 0, width: 8, height: 597)
handLayer.position = CGPoint(x: 24.010862, y: 24)
handLayer.anchorPoint = CGPoint(x: 0.5, y: 0.15)
handLayer.contentsGravity = kCAGravityCenter
handLayer.backgroundColor = color.cgColor
handLayer.borderColor = bordercolor10.cgColor
handLayer.shadowOpacity = 1
handLayer.shadowRadius = 1
handLayer.shadowOffset = CGSize(width: 0, height: 1)
// Hand Animations
//
// bounds.size.height
//
let boundsSizeHeightAnimation3 = CABasicAnimation()
boundsSizeHeightAnimation3.beginTime = 0.000001
boundsSizeHeightAnimation3.duration = 0.2
boundsSizeHeightAnimation3.fillMode = kCAFillModeBoth
boundsSizeHeightAnimation3.isRemovedOnCompletion = false
boundsSizeHeightAnimation3.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
boundsSizeHeightAnimation3.keyPath = "bounds.size.height"
boundsSizeHeightAnimation3.toValue = 612
boundsSizeHeightAnimation3.fromValue = 563
// shadowRadius
//
let shadowradiusAnimation1 = CABasicAnimation()
shadowradiusAnimation1.beginTime = 0.000001
shadowradiusAnimation1.duration = 0.2
shadowradiusAnimation1.fillMode = kCAFillModeBoth
shadowradiusAnimation1.isRemovedOnCompletion = false
shadowradiusAnimation1.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
shadowradiusAnimation1.keyPath = "shadowRadius"
shadowradiusAnimation1.toValue = 1
shadowradiusAnimation1.fromValue = 0
// transform.scale.x
//
let transformScaleXAnimation = CABasicAnimation()
transformScaleXAnimation.beginTime = 0.000001
transformScaleXAnimation.duration = 0.2
transformScaleXAnimation.fillMode = kCAFillModeBoth
transformScaleXAnimation.isRemovedOnCompletion = false
transformScaleXAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
transformScaleXAnimation.keyPath = "transform.scale.x"
transformScaleXAnimation.toValue = 1
transformScaleXAnimation.fromValue = 3
// shadowOpacity
//
let shadowopacityAnimation = CABasicAnimation()
shadowopacityAnimation.beginTime = 0.000001
shadowopacityAnimation.duration = 0.2
shadowopacityAnimation.fillMode = kCAFillModeBoth
shadowopacityAnimation.isRemovedOnCompletion = false
shadowopacityAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
shadowopacityAnimation.keyPath = "shadowOpacity"
shadowopacityAnimation.toValue = 1
shadowopacityAnimation.fromValue = 0
secondHandLayer.addSublayer(handLayer)
// Inner Point
//
let innerPointLayer = CALayer()
innerPointLayer.name = "Inner Point"
innerPointLayer.bounds = CGRect(x: 0, y: 0, width: 32, height: 32)
innerPointLayer.position = CGPoint(x: 24, y: 24)
innerPointLayer.anchorPoint = CGPoint(x: 0.499661, y: 0.5)
innerPointLayer.contentsGravity = kCAGravityCenter
innerPointLayer.backgroundColor = color.cgColor
innerPointLayer.cornerRadius = 16
innerPointLayer.borderColor = bordercolor11.cgColor
innerPointLayer.shadowOffset = CGSize(width: 0, height: 1)
// Inner Point Sublayers
//
// Center Point
//
let centerPointLayer = CALayer()
centerPointLayer.name = "Center Point"
centerPointLayer.bounds = CGRect(x: 0, y: 0, width: 16, height: 16)
centerPointLayer.position = CGPoint(x: 15.989138, y: 16)
centerPointLayer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
centerPointLayer.contentsGravity = kCAGravityCenter
centerPointLayer.backgroundColor = backgroundcolor.cgColor
centerPointLayer.cornerRadius = 8
centerPointLayer.borderWidth = 1
centerPointLayer.borderColor = bordercolor12.cgColor
centerPointLayer.shadowOffset = CGSize(width: 0, height: 1)
// Center Point Animations
//
// backgroundColor
//
let backgroundcolorAnimation5 = CABasicAnimation()
backgroundcolorAnimation5.beginTime = 0.000001
backgroundcolorAnimation5.duration = 0.2
backgroundcolorAnimation5.fillMode = kCAFillModeBoth
backgroundcolorAnimation5.isRemovedOnCompletion = false
backgroundcolorAnimation5.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
backgroundcolorAnimation5.keyPath = "backgroundColor"
backgroundcolorAnimation5.toValue = backgroundcolor.cgColor
backgroundcolorAnimation5.fromValue = color.cgColor
innerPointLayer.addSublayer(centerPointLayer)
secondHandLayer.addSublayer(innerPointLayer)
watchBackgroundLayer.addSublayer(secondHandLayer)
screenLayer.addSublayer(watchBackgroundLayer)
self.layer.addSublayer(screenLayer)
// Layer Instance Assignments
//
self.watchBackgroundLayer = watchBackgroundLayer
self.innerBackgroundLayer = innerBackgroundLayer
self.minuteMarkerLayer = minuteMarkerLayer
self.hourMarkerLayer = hourMarkerLayer
self.leafLayer = leafLayer
self.stemLayer = stemLayer
self.minuteHandLayer = minuteHandLayer
self.leafLayer1 = leafLayer1
self.stemLayer1 = stemLayer1
self.secondHandLayer = secondHandLayer
self.handLayer = handLayer
self.centerPointLayer = centerPointLayer
self.shadeLayer = shadeLayer
self.unnamedLayer = unnamedLayer
self.unnamedLayer1 = unnamedLayer1
self.unnamedLayer2 = unnamedLayer2
self.unnamedLayer3 = unnamedLayer3
self.unnamedLayer4 = unnamedLayer4
self.unnamedLayer5 = unnamedLayer5
self.unnamedLayer6 = unnamedLayer6
self.unnamedLayer7 = unnamedLayer7
self.unnamedLayer8 = unnamedLayer8
self.unnamedLayer9 = unnamedLayer9
self.unnamedLayer10 = unnamedLayer10
self.unnamedLayer11 = unnamedLayer11
// Animation Instance Assignments
//
self.whiteToBlackAnimation = whiteToBlackAnimation
self.scaleDownAnimation = scaleDownAnimation
self.scaleUpAnimation = scaleUpAnimation
self.opacityUpAnimation = opacityUpAnimation
self.opacityDownAnimation = opacityDownAnimation
self.boundsSizeAnimation = boundsSizeAnimation
self.cornerradiusAnimation = cornerradiusAnimation
self.transformScaleAnimation = transformScaleAnimation
self.transformScaleAnimation1 = transformScaleAnimation1
self.transformScaleAnimation2 = transformScaleAnimation2
self.transformScaleAnimation3 = transformScaleAnimation3
self.transformScaleAnimation4 = transformScaleAnimation4
self.transformScaleAnimation5 = transformScaleAnimation5
self.transformScaleAnimation6 = transformScaleAnimation6
self.transformScaleAnimation7 = transformScaleAnimation7
self.transformScaleAnimation8 = transformScaleAnimation8
self.transformScaleAnimation9 = transformScaleAnimation9
self.transformScaleAnimation10 = transformScaleAnimation10
self.transformScaleAnimation11 = transformScaleAnimation11
self.boundsSizeHeightAnimation = boundsSizeHeightAnimation
self.boundsSizeHeightAnimation1 = boundsSizeHeightAnimation1
self.backgroundcolorAnimation = backgroundcolorAnimation
self.boundsSizeWidthAnimation = boundsSizeWidthAnimation
self.cornerradiusAnimation1 = cornerradiusAnimation1
self.backgroundcolorAnimation1 = backgroundcolorAnimation1
self.boundsSizeWidthAnimation1 = boundsSizeWidthAnimation1
self.shadowradiusAnimation = shadowradiusAnimation
self.boundsSizeHeightAnimation2 = boundsSizeHeightAnimation2
self.backgroundcolorAnimation2 = backgroundcolorAnimation2
self.boundsSizeWidthAnimation2 = boundsSizeWidthAnimation2
self.cornerradiusAnimation2 = cornerradiusAnimation2
self.backgroundcolorAnimation3 = backgroundcolorAnimation3
self.boundsSizeWidthAnimation3 = boundsSizeWidthAnimation3
self.backgroundcolorAnimation4 = backgroundcolorAnimation4
self.boundsSizeHeightAnimation3 = boundsSizeHeightAnimation3
self.shadowradiusAnimation1 = shadowradiusAnimation1
self.transformScaleXAnimation = transformScaleXAnimation
self.shadowopacityAnimation = shadowopacityAnimation
self.backgroundcolorAnimation5 = backgroundcolorAnimation5
}
// MARK: - Responder
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)
{
guard let location = touches.first?.location(in: self.superview),
let hitLayer = self.layer.presentation()?.hitTest(location) else { return }
print("Layer \(hitLayer.name ?? String(describing: hitLayer)) was tapped.")
// Call action methods
//
self.mouseUpPlayAnimationsAction(self)
self.mouseDownPlayAnimationsAction(self)
}
// MARK: - Actions
@IBAction func mouseUpPlayAnimationsAction(_ sender: Any?)
{
self.scaleUpAnimation!.beginTime = self.watchBackgroundLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.watchBackgroundLayer?.add(self.scaleUpAnimation!, forKey: "scaleUpAnimation")
self.whiteToBlackAnimation!.beginTime = self.watchBackgroundLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.watchBackgroundLayer?.add(self.whiteToBlackAnimation!, forKey: "whiteToBlackAnimation")
self.boundsSizeAnimation!.beginTime = self.innerBackgroundLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.innerBackgroundLayer?.add(self.boundsSizeAnimation!, forKey: "boundsSizeAnimation")
self.cornerradiusAnimation!.beginTime = self.innerBackgroundLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.innerBackgroundLayer?.add(self.cornerradiusAnimation!, forKey: "cornerradiusAnimation")
self.boundsSizeHeightAnimation!.beginTime = self.minuteMarkerLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.2
self.minuteMarkerLayer?.add(self.boundsSizeHeightAnimation!, forKey: "boundsSizeHeightAnimation")
self.boundsSizeHeightAnimation1!.beginTime = self.hourMarkerLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.2
self.hourMarkerLayer?.add(self.boundsSizeHeightAnimation1!, forKey: "boundsSizeHeightAnimation1")
self.backgroundcolorAnimation!.beginTime = self.leafLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.leafLayer?.add(self.backgroundcolorAnimation!, forKey: "backgroundcolorAnimation")
self.boundsSizeWidthAnimation!.beginTime = self.leafLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.leafLayer?.add(self.boundsSizeWidthAnimation!, forKey: "boundsSizeWidthAnimation")
self.cornerradiusAnimation1!.beginTime = self.leafLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.leafLayer?.add(self.cornerradiusAnimation1!, forKey: "cornerradiusAnimation1")
self.backgroundcolorAnimation1!.beginTime = self.stemLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.stemLayer?.add(self.backgroundcolorAnimation1!, forKey: "backgroundcolorAnimation1")
self.boundsSizeWidthAnimation1!.beginTime = self.stemLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.stemLayer?.add(self.boundsSizeWidthAnimation1!, forKey: "boundsSizeWidthAnimation1")
self.shadowradiusAnimation!.beginTime = self.minuteHandLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.minuteHandLayer?.add(self.shadowradiusAnimation!, forKey: "shadowradiusAnimation")
self.boundsSizeHeightAnimation2!.beginTime = self.leafLayer1!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.leafLayer1?.add(self.boundsSizeHeightAnimation2!, forKey: "boundsSizeHeightAnimation2")
self.backgroundcolorAnimation2!.beginTime = self.leafLayer1!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.leafLayer1?.add(self.backgroundcolorAnimation2!, forKey: "backgroundcolorAnimation2")
self.boundsSizeWidthAnimation2!.beginTime = self.leafLayer1!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.leafLayer1?.add(self.boundsSizeWidthAnimation2!, forKey: "boundsSizeWidthAnimation2")
self.cornerradiusAnimation2!.beginTime = self.leafLayer1!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.leafLayer1?.add(self.cornerradiusAnimation2!, forKey: "cornerradiusAnimation2")
self.backgroundcolorAnimation3!.beginTime = self.stemLayer1!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.stemLayer1?.add(self.backgroundcolorAnimation3!, forKey: "backgroundcolorAnimation3")
self.boundsSizeWidthAnimation3!.beginTime = self.stemLayer1!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.stemLayer1?.add(self.boundsSizeWidthAnimation3!, forKey: "boundsSizeWidthAnimation3")
self.backgroundcolorAnimation4!.beginTime = self.secondHandLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.secondHandLayer?.add(self.backgroundcolorAnimation4!, forKey: "backgroundcolorAnimation4")
self.boundsSizeHeightAnimation3!.beginTime = self.handLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.handLayer?.add(self.boundsSizeHeightAnimation3!, forKey: "boundsSizeHeightAnimation3")
self.shadowradiusAnimation1!.beginTime = self.handLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.handLayer?.add(self.shadowradiusAnimation1!, forKey: "shadowradiusAnimation1")
self.transformScaleXAnimation!.beginTime = self.handLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.handLayer?.add(self.transformScaleXAnimation!, forKey: "transformScaleXAnimation")
self.backgroundcolorAnimation5!.beginTime = self.centerPointLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.centerPointLayer?.add(self.backgroundcolorAnimation5!, forKey: "backgroundcolorAnimation5")
self.opacityDownAnimation!.beginTime = self.shadeLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.shadeLayer?.add(self.opacityDownAnimation!, forKey: "opacityDownAnimation")
self.transformScaleAnimation!.beginTime = self.unnamedLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.2
self.unnamedLayer?.add(self.transformScaleAnimation!, forKey: "transformScaleAnimation")
self.transformScaleAnimation1!.beginTime = self.unnamedLayer1!.convertTime(CACurrentMediaTime(), from: nil) + 0.2067
self.unnamedLayer1?.add(self.transformScaleAnimation1!, forKey: "transformScaleAnimation1")
self.transformScaleAnimation2!.beginTime = self.unnamedLayer2!.convertTime(CACurrentMediaTime(), from: nil) + 0.2257
self.unnamedLayer2?.add(self.transformScaleAnimation2!, forKey: "transformScaleAnimation2")
self.transformScaleAnimation3!.beginTime = self.unnamedLayer3!.convertTime(CACurrentMediaTime(), from: nil) + 0.2438
self.unnamedLayer3?.add(self.transformScaleAnimation3!, forKey: "transformScaleAnimation3")
self.transformScaleAnimation4!.beginTime = self.unnamedLayer4!.convertTime(CACurrentMediaTime(), from: nil) + 0.2581
self.unnamedLayer4?.add(self.transformScaleAnimation4!, forKey: "transformScaleAnimation4")
self.transformScaleAnimation5!.beginTime = self.unnamedLayer5!.convertTime(CACurrentMediaTime(), from: nil) + 0.2778
self.unnamedLayer5?.add(self.transformScaleAnimation5!, forKey: "transformScaleAnimation5")
self.transformScaleAnimation6!.beginTime = self.unnamedLayer6!.convertTime(CACurrentMediaTime(), from: nil) + 0.29
self.unnamedLayer6?.add(self.transformScaleAnimation6!, forKey: "transformScaleAnimation6")
self.transformScaleAnimation7!.beginTime = self.unnamedLayer7!.convertTime(CACurrentMediaTime(), from: nil) + 0.3054
self.unnamedLayer7?.add(self.transformScaleAnimation7!, forKey: "transformScaleAnimation7")
self.transformScaleAnimation8!.beginTime = self.unnamedLayer8!.convertTime(CACurrentMediaTime(), from: nil) + 0.3224
self.unnamedLayer8?.add(self.transformScaleAnimation8!, forKey: "transformScaleAnimation8")
self.transformScaleAnimation9!.beginTime = self.unnamedLayer9!.convertTime(CACurrentMediaTime(), from: nil) + 0.3388
self.unnamedLayer9?.add(self.transformScaleAnimation9!, forKey: "transformScaleAnimation9")
self.transformScaleAnimation10!.beginTime = self.unnamedLayer10!.convertTime(CACurrentMediaTime(), from: nil) + 0.3555
self.unnamedLayer10?.add(self.transformScaleAnimation10!, forKey: "transformScaleAnimation10")
self.transformScaleAnimation11!.beginTime = self.unnamedLayer11!.convertTime(CACurrentMediaTime(), from: nil) + 0.3735
self.unnamedLayer11?.add(self.transformScaleAnimation11!, forKey: "transformScaleAnimation11")
self.shadowopacityAnimation!.beginTime = self.handLayer!.convertTime(CACurrentMediaTime(), from: nil) + 0.000001
self.handLayer?.add(self.shadowopacityAnimation!, forKey: "shadowopacityAnimation")
}
@IBAction func mouseDownPlayAnimationsAction(_ sender: Any?)
{
self.scaleDownAnimation!.beginTime = self.watchBackgroundLayer!.convertTime(CACurrentMediaTime(), from: nil)
self.watchBackgroundLayer?.add(self.scaleDownAnimation!, forKey: "scaleDownAnimation")
self.opacityUpAnimation!.beginTime = self.shadeLayer!.convertTime(CACurrentMediaTime(), from: nil)
self.shadeLayer?.add(self.opacityUpAnimation!, forKey: "opacityUpAnimation")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment