daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Dec 14th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func pulseBorderColor() {
  2.     let pulseAnimation = CABasicAnimation(keyPath: "borderColor")
  3.     pulseAnimation.duration = 0.35
  4.     pulseAnimation.fromValue = UIColor.green.cgColor
  5.     pulseAnimation.toValue = UIColor(red: 252/255, green: 180/255, blue: 29/255, alpha: 1.0).cgColor
  6.     pulseAnimation.fillMode = kCAFillModeForwards
  7.     pulseAnimation.isRemovedOnCompletion = false
  8.     pulseAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
  9.     nationalIdentityTextField.layer.sublayers![0].add(pulseAnimation,forKey: nil)
  10. }
  11.    
  12. func reversePulseBorderColor() {
  13.     let pulseAnimation = CABasicAnimation(keyPath: "borderColor")
  14.     pulseAnimation.duration = 0.35
  15.     pulseAnimation.fromValue = UIColor(red: 252/255, green: 180/255, blue: 29/255, alpha: 1.0).cgColor
  16.     pulseAnimation.toValue = UIColor.green.cgColor
  17.     pulseAnimation.fillMode = kCAFillModeForwards
  18.     pulseAnimation.isRemovedOnCompletion = false
  19.     pulseAnimation.timingFunction = CAMediaTimingFunction(name:  kCAMediaTimingFunctionEaseInEaseOut)
  20.     nationalIdentityTextField.layer.sublayers![0].add(pulseAnimation,forKey: nil)
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top