Search code examples
swiftanimationframecgrect

How can we move a UILabel to the new point, like the transitions of powerpoint?


When we use this one:

Do.frame =  CGRect (x:new x, y: new y, width: new width, height: new height)

it jumps to the new point. I want something animated.


Solution

  •   UIView.animate(withDuration: 0.3, animations: { 
          Do.frame =  CGRect (x:new x, y: new y, width: new width, height: new height)
      })
    

    Of course, I don't think that compiles, but you get the idea.