【发布时间】:2015-11-06 21:11:03
【问题描述】:
我通过代码创建了一个按钮:
var button = UIButton.buttonWithType(UIButtonType.System) as! UIButton
button.frame = CGRectMake(100, 100, 100, 50)
button.setTitle("Button", forState: UIControlState.Normal)
button.addTarget(self, action: "Action:", forControlEvents: UIControlEvents.TouchUpInside)
self.view.addSubview(button)`
但现在我想做一个转场,当点击按钮时。通常我是用@IBAction 来做的,但现在我不是在 IB 中制作了这个按钮,而是通过代码制作的。那么,如何设置segue呢?
【问题讨论】: