【发布时间】:2017-10-19 01:00:45
【问题描述】:
尝试为我的注册按钮创建一个 segue,该按钮会将用户发送到允许他们在我的数据库中注册的页面。
通常,我为我的按钮制作一个按钮和一个目标,它通过一个函数执行一些操作。
我们可以让这个函数转场 PROGRAMMATICALLY 请注意我根本没有使用故事板?
代码片段:
lazy var registerButton: UIButton = {
let rButton = UIButton(type: .system)
rButton.frame = CGRect(x: 210, y: 600, width: 100, height: 50)
rButton.setTitle("REGISTER", for: .normal)
rButton.backgroundColor = UIColor.white
rButton.translatesAutoresizingMaskIntoConstraints = false
rButton.setTitleColor(UIColor.black, for: .normal)
rButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 20)
rButton.layer.cornerRadius = 20
rButton.layer.borderWidth = 2
rButton.addTarget(self, action: #selector(regSegue), for: .touchUpInside)
return rButton
}()
// will segue for me
func regSegue(){
}
【问题讨论】:
-
任何帮助表示赞赏
-
@Idan 可能不会
标签: ios swift uistoryboardsegue