Hola,
estoy tratando de correr un código a través del cual le doy animación a una imagen, consiste en bajar la imagen y al mismo tiempo modificar su tamaño pero este solo logro moverla no así que cambie sus dimensiones,
import UIKit
import QuartzCore
class ViewController: UIViewController {
@IBOutlet weak var imagen: UIImageView!
@IBAction func animar(sender: AnyObject) {
var animation = CABasicAnimation(keyPath: "position")
animation.fromValue = NSValue(CGPoint: CGPointMake(self.imagen.frame.midX, self.imagen.frame.midY))
animation.toValue = NSValue(CGPoint: CGPointMake(160, 200))
animation.timingFunction = CAMediaTimingFunction(name:kCAMediaTimingFunctionLinear)
animation.duration = 3.0
** var resizeAnimation = CABasicAnimation(keyPath: "bound.size")
resizeAnimation.fromValue = NSValue(CGSize: self.imagen.bounds.size)
resizeAnimation.toValue = NSValue(CGSize: CGSizeMake(200, 50))
resizeAnimation.timingFunction = CAMediaTimingFunction(name:kCAMediaTimingFunctionLinear)
resizeAnimation.duration = 3.0**
imagen.layer.addAnimation(animation, forKey: "position")
imagen.layer.addAnimation(resizeAnimation, forKey: "bound.size")
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Gracias