I have a UIImageView. I also have a view. I want the view to appear on top of the UIImageView as it animates across the screen. I DO NOT want the view to appear in the background though.
How can I do this?
I have tried changing the order of subviews by adding another subview however this is impossible to do.
I was considering using a layer rather than a view to animate however the UIImageView has transparent portions around it.
Code: (note: isAnimating is a class property, don't worry about it)
@IBAction func AnimateBtnTapped(sender: AnyObject) {
if (isAnimating == false) {
isAnimating = true
UIView.animateWithDuration(0.6, delay: 0.0, options: .Repeat, animations: {
self.glintImageConstraint.constant += 450
self.view.layoutIfNeeded()
}, completion: nil)
} else {
isAnimating = false
self.glintImageView.layer.removeAllAnimations() //stop animation
self.glintImageConstraint.constant = -200 //set glintImage to original position
self.view.layoutIfNeeded()
}
}
My UIImageView is a medallion. The glintImageView is the object animation across on top of it.
EDIT: I am asking for an equivalent to Shimmer ( https://github.com/facebook/Shimmer ) however for UIImageView.