Access container view child properties swift

后端 未结 4 845
悲&欢浪女
悲&欢浪女 2021-02-12 04:18

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:35

    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
        }
    }
    

提交回复
热议问题