How do I show and/or hide a subview using swift

后端 未结 4 1552
夕颜
夕颜 2021-02-01 15:52

So I\'ve created a ViewControl in my storyboard that has 3 subviews. Each one represents a different view I want to show depending on which table row was selected on the previou

4条回答
  •  萌比男神i
    2021-02-01 16:10

    You should create IBOutlets for each of the three subviews. Then you can show/hide each of them directly from those references. If you hide a view, it will automatically hide its subviews.

    Once you have an outlet for the view, you can do this: viewYouWantToHide.isHidden = true

提交回复
热议问题