我在同一ViewControllerA中有ViewControllerA和一个subView。我想知道如何将ViewContorllerA的插座标签值传递到其subView。

最佳答案

请尝试使用此方法。我认为这将对您有用。在此处传递您的出口价值。

           let destVC = self.storyboard?.instantiateViewController(withIdentifier: "CategoryDescriptionViewController_id") as? CategoryDescriptionViewController

            destVC?.aTitleText = ""

            destVC?.aDescText = ""

            destVC?.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height)
            self.addChildViewController(destVC ?? UIViewController())
            self.view.addSubview((destVC?.view)!)
            destVC?.didMove(toParentViewController: self)

关于swift - 如何将ViewContorller的 socket 值传递到其subView Swift,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46628134/

10-10 09:56