Segue和Button以编程方式迅捷
我正在使用iCarousel,我必须创建自己的按钮。我想将编程按钮中的数据传递给另一个视图,但我没有segue标识符,因为我以编程方式创建了按钮。我不知道是否可以通过编程方式创建segue的标识符。
button.addTarget(self, action: #selector(buttonAction3), for: .touchUpInside)
button.setTitle("\(titulos[index])", for: .normal)
tempView.addSubview(button)
let myImage = UIImage(named: "modo4.png") as UIImage?
button.setImage(myImage, for: .normal)let viewController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "modo") as! Modo1ViewControllerself.present(viewController, animated: false, completion: nil)if segue.identifier == "" {
if let destination = segue.destination as? Modo1ViewController {
destination.nomb = nombres }
}一只萌萌小番薯
不负相思意