In my application I am adding labels to the view and then I am attempting to clear particular labels from the view when a button is clicked and am running into an error when trying to retrieve the subviews:
class FirstViewController: UIViewController {
@IBAction func btnAddTask_Click(sender: UIButton){
var subViews = self.subviews.copy()
}
}
I get the error:
'FirstViewController' does not have a member named 'subviews'
How can I get the subviews of the current view?
self.view.subviews
? – Sufficient