I have a UIView ("myUIView") in my ViewController ("mainView") that has a UILabel ("myUILabel") inside, centered vertically with autolayout constraints. I'm animating this UIView to change its height.
Originally, I thought auto layout would keep track of the animation/change and keep the UILabel centered, but instead the UILabel acts as though it is constrained to the top of the UIView.
The UILabel isn't in the animation code itself. Code for reference:
UIView.animateWithDuration(currentAnimationTime, delay: 0.0, options: .CurveEaseOut, animations: {
self.myUIView.frame = CGRectMake(0, self.mainView.frame.height * 0.2, self.mainView.frame.width, self.mainView.frame.height * 0.6 )
}, completion: nil)
How can I increase the UIView's height and keep my UILabel entered vertically? Will I need to add something that directly affects the UILabel itself, or am I going about the resize itself (CGRectMake) all wrong?