我正在尝试将UILabel重新定位在另一个UILabel(相同位置)上。它没有完全定位在目标UILabel上。
见下面的代码
let element1yPosition = element1.frame.origin.y. // Element 1 y Position
let element2yPosition = element2.frame.origin.y. // Element 2 y Position
UIView.animate(withDuration: 1.0, animations: {
element1.frame.origin.y = element2yPosition // Repositioning stage.
//Fails because Element 1 doesn't re-position itself in the exact same position as Element 2 as required.
})