iOS Swift 5 Tutorial: Superview and Subviews in iOS Hindi 2020.
seen from China
seen from United States
seen from China
seen from United States

seen from Israel
seen from Germany
seen from Netherlands
seen from United States

seen from Chile
seen from Israel

seen from United States

seen from France
seen from United States
seen from Türkiye
seen from China
seen from China

seen from Finland

seen from United States
seen from Türkiye
seen from United States
iOS Swift 5 Tutorial: Superview and Subviews in iOS Hindi 2020.
When my app gets back to its root view controller, in the viewDidAppear: method I need to remove all subviews. How can I do this?
original source : https://stackoverflow.com/questions/2156015/remove-all-subviews
In Swift you can use a functional approach like this:
view.subviews.forEach { $0.removeFromSuperview() }
As a comparison, the imperative approach would look like this:
for subview in view.subviews { subview.removeFromSuperview() }
These code snippets only work in iOS / tvOS though, things are a little different on macOS.