Animate the position of a Window. Swift and macOS

Viewed 105

How can I animate the position of a window with Swift, macOS, Storyboard.

What I have tried:

@IBAction func move(_ sender: NSButton) {
    NSAnimationContext.runAnimationGroup({ (context) in
      context.duration = 2.0
        self.view.window?.setFrame(NSRect(x:50,y:50,
                                          width:200,
                                          height:300),
                                   display: true)
    })
}

This works well to move it. But it jumps and I try to make it animate. Is it possible?

0 Answers
Related