Ios 真的需要把这个CGRect代码从Objective-C翻译成Swift

Ios 真的需要把这个CGRect代码从Objective-C翻译成Swift,ios,objective-c,position,swift,translate,Ios,Objective C,Position,Swift,Translate,我需要更改单击(iOS)时ui按钮的位置。我发现一个教程说: -(IBAction) move { CGRect frame = [buttonMove frame]; frame.origin.x = 100; frame.origin.y = 10; [buttonMove setFrame: frame]; } 有人能帮我翻译成斯威夫特吗 这里没什么难的,只是语法问题 @IBAction func move() {

我需要更改单击(iOS)时
ui按钮的位置。我发现一个教程说:

-(IBAction) move {    
   CGRect frame = [buttonMove frame];    
   frame.origin.x = 100;    
   frame.origin.y = 10;    
   [buttonMove setFrame: frame];    
}

有人能帮我翻译成斯威夫特吗

这里没什么难的,只是语法问题

@IBAction func move() {
    var frame = buttonMove.frame;
    frame.origin.x = 100
    frame.origin.y = 10;
    buttonMove.frame = frame;
}

你应该试着自己转换它,展示你尝试过的,并询问哪些不正常工作。。。