xcode Removing Some Subviews from view

前端 未结 2 1985
广开言路
广开言路 2020-12-30 06:55

Greetings all,

I am a noob and I have been trying to work through this for a few days.

I am adding images to a view via UItouch. The view contains a backgro

2条回答
  •  情书的邮戳
    2020-12-30 07:37

    A more swiftly code for approach #1 in only one functional line of code :

    self.view.subviews.filter({$0.tag == 7}).forEach({$0.removeFromSuperview()})
    

提交回复
热议问题