Advertisement
neatekFb

Smooth change ImageView // swift 3

Dec 2nd, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.38 KB | None | 0 0
  1. //// Vladimir Zhelnov - neatek.pw - Web/iOS dev
  2.                    
  3. let fadeAnim:CABasicAnimation = CABasicAnimation(keyPath: "contents");
  4. fadeAnim.fromValue = self.imageViewOut.image;
  5. fadeAnim.toValue   = image; // new image
  6. fadeAnim.duration  = 0.8;         //smoothest value
  7. self.imageblur.layer.add(fadeAnim, forKey: "contents");
  8. self.imageblur.image = image; // set new image
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement