复制函数的变量

时间:2014-11-25 20:39:09

标签: ios8

在我的代码中,我有这个功能

 @IBAction func go(sender: AnyObject) {

    let Button = sender as UIButton
    name = Button.titleLabel!.text
    var label: UILabel = UILabel()
    label.frame = CGRectMake(self.view.frame.size.width/2, 10, 150, 21);
    label.backgroundColor = UIColor.blackColor()
    label.textColor = UIColor.whiteColor()
    label.textAlignment = NSTextAlignment.Center
    label.text = "\(self.name)"
    self.view.addSubview(label)
    }

我想在此函数中复制label.text值

 override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if segue.identifier == "go" {
       }
 }

0 个答案:

没有答案