SHARE
TWEET

Untitled

a guest Oct 12th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         let part = CGFloat(totalScoreView.score)/100.0
  2.         let endAngle = part != 0 ? CGFloat(Double.pi * 1.5) * part : CGFloat(Double.pi / -2)
  3.  
  4.         let circlePath = UIBezierPath(arcCenter: CGPoint(x: infoButtonViewParent.bounds.midX, y: infoButtonViewParent.bounds.midY), radius: totalScoreView.frame.size.width/1.65, startAngle: CGFloat(Double.pi / -2), endAngle: endAngle, clockwise: true)
  5.        
  6.         let positionAnimation = CAKeyframeAnimation(keyPath: "position");
  7.         positionAnimation.duration = kScoreCircleAnimationDuration
  8.         positionAnimation.path = circlePath.cgPath
  9.         positionAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
  10.         positionAnimation.fillMode = kCAFillModeForwards
  11.         positionAnimation.delegate = self
  12.         positionAnimation.isRemovedOnCompletion = false
  13.         infoButtonView.layer.add(positionAnimation, forKey: nil)
RAW Paste Data
Top