I was thinking maybe something like this might work:
for (UIView* b in self.view.subviews)
{
[b removeFromSuperview];
}
You can use like this
//adding an object to the view
view.addSubView(UIButton())
// you can remove any UIControls you have added with this code
view.subviews.forEach { (item) in
item.removeFromSuperview()
}
view is the view that you want to remove everything from. you are just removing every subview by doing forEach