I’m attempting to create an animation where it appears as if a UIButton is flipping horizontally
This SHOULD be the code
public func animateFLIP( _ newValue:Bool) {
if zFaceDown != newValue {
UIView.animate(withDuration: speed_CARDFLIP , delay: 0.0, options: .curveLinear, animations: {
self.transform = CGAffineTransform(scaleX: 0.01, y: 1);
},completion: { _ in
self.isFaceDown = newValue
UIView.animate(withDuration: speed_CARDFLIP , delay: 0.0, options: .curveLinear, animations: {
self.transform = CGAffineTransform(scaleX: 1, y: 1);
})
})
}
}
but the first transform makes the UIButton wider than the whole screen (when in fact it should go to 1% of its starting width
The 2nd transform is suppose to return it to normal… but in fact returns it to about 2x its original size