Estoy realizando un código a través del cual cambio de lugar una imagen y a la vez se modifica el tamaño de la misma utilizando CGSizeMake
, pero no logro modificar las dimensiones solo desplazarlo,
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.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.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.
}
}
no encuentro el error,
gracias por la ayuda