Access container view child properties swift

后端 未结 4 1608
情书的邮戳
情书的邮戳 2021-02-12 04:20

What I want to achieve:

User presses the button in the ViewController then, the color of the button placed in the container view should change its color to red.

4条回答
  •  没有蜡笔的小新
    2021-02-12 04:42

    Swift 4, Xcode 9.4.1

    var contentViewController : UIContentViewController?
    
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == containerSegueName {
           contentViewController = segue.destination as? UIContentViewController
        }
    }
    

提交回复
热议问题