swift
swift

Reputation: 75

Increasing an images size over time?

I have an image that needs to increase in size over time. How would I go about doing that?

var timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: Selector("grow"), userInfo: nil, repeats: true)

For the actual function I am confused how to write it.

Upvotes: 0

Views: 73

Answers (1)

Thomas
Thomas

Reputation: 2367

If you want a fluid animation, use this:

UIView.animateWithDuration(0.4, animations: { () -> Void in
    imageView.transform = CGAffineTransformMakeScale(2.0, 2.0)
})

Upvotes: 1

Related Questions