UIView.animate似乎动画到了错误的位置
card.view.transform = CGAffineTransform(scaleX: CGFloat(scale), y: CGFloat(scale)).rotated(by: CGFloat(rads))
print("animating to [\(x), \(y)]")
UIView.animate(withDuration: 0.3, delay: 0, options: .curveEaseInOut, animations: {
card.view.center = CGPoint(x: x, y: y)
card.view.transform = .identity
}, completion: { (suc) in
card.view.isHidden = true
print("view center : \(self.view.center) card center: \(card.view.center)")
})
它确实动画到了错误的位置。印刷节目也是如此:
动画为[480.0,234.0]
观看中心:(160.0,284.0)卡中心:(160.0,284.0)