What is the easiest way (in Swift) to create a function that triggers a UI animation when one touches a view and another animation when you stop touching that view, so this is what i am trying to write.
Code:
func TapView1(){
//touching View1
UIView.animateWithDuration(1.0, animations: {
View1.frame = CGRect(x: 100, y: 100, width: 100, height: 100)
})
//stops touching View1
UIView.animateWithDuration(1.0, animations: {
View1.frame = CGRect(x: 50, y: 50, width: 50, height: 50)
})
}
Last edited by a moderator: