You can use a completion handler to execute code after the transformation:
UIView.animate(withDuration: 5.0) {
self.hhview.transform = CGAffineTransform(translationX: -160, y: 0)
} completion: { _ in
print("Completed")
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…