gpt4 book ai didi

ios - 函数返回值(操作按钮)

转载 作者:行者123 更新时间:2023-11-30 10:24:07 27 4
gpt4 key购买 nike

有谁知道如何从该函数返回一个值?我想返回 t ,该值是图像博士。我想返回这个 View Controller 中的值

@IBAction func firmaButton(_ sender: Any)  {
let storyBoard1 : UIStoryboard = UIStoryboard(name: "NuevaCuenta", bundle: nil)
let ViewControllerDos1 = storyBoard1.instantiateViewController(withIdentifier: "NCFirma") as! NCFirma
ViewControllerDos1.modalPresentationStyle = .fullScreen

ViewControllerDos1.clickedCallback = { t in
self.firmaButton.setImage(t, for: .normal)
self.firmaButton.transform = self.firmaButton.transform.rotated(by: CGFloat(M_PI_2))
self.firmaButton.frame = CGRect(x: 13, y: 8, width: 294, height: 112)
self.firmaButton.clipsToBounds = true
RegTempNuevaCuenta.imgFirma = t
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.myOrientation = .portrait

}

self.navigationController?.pushViewController(ViewControllerDos1, animated: true)



}

最佳答案

@IBAction 函数是基于用户交互的系统函数。它们不返回任何内容,并且此类型函数的返回类型为 Void

关于ios - 函数返回值(操作按钮),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60173786/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com