I've been looking at the different examples of loading a screen - is there a way to insert a transition screen (sliding) when the a tap is detected? Currently UIImage.imageNamed loads up the next graphic instantly - how to make it slide?
def viewDidLoad
view.image = UIImage.imageNamed('welcome.png')
view.userInteractionEnabled = true
recognizer = UITapGestureRecognizer.alloc.initWithTarget(self, action:'nextScreen')
view.addGestureRecognizer(recognizer)
end
Here is a nextScreen
method that should do what you want. With the animation setup, the view.image = ...
line will slide the image in from the right.
def nextScreen
animation = CATransition.animation
animation.duration = 0.5
animation.type = KCATransitionMoveIn
animation.subtype = KCATransitionFromRight
view.layer.addAnimation(animation, forKey:'imageTransition')
view.image = UIImage.imageNamed('pic2.png')
end