I have what I thought would be a simple requirement but I can't seem to get the effect that I want.
I have a button and a label next to each other. When the button is touched it disappears and the label is to expand to occupy the space vacated by the button. So, basically, the label's origin and width need to change but the right amrgin stays where its at.
I'm not using auto-layout in this case.
I've played around with the label's frame, center and bounds properties inside UIView.animateWithDuration() but I can't seem to get the effect that I want. For example, with the code below, the label snaps to the new center and then grows to occupy it's final location.
UIView.animateWithDuration(0.5, animations: {
label.frame = newFrame
label.center = newCenter
})I would like for the label's right margin to stay where it is and the animation of the origin and width to make the label grow to the left to occupy the space where the button was.
My next thought was to look at layer animations but I've wasted a few hours on this and would like some guidance.
Thank you!