你必须调用offsetBy一个实例CGRect.
offsetBy
CGRect
self.view.frame = self.view.frame.offsetBy(dx: 0, dy: movement)