I used the map
function in Swift to iterate on a bunch of subviews and remove them from a superview.
self.buttons.map { $0.removeFromSuperview() }
When I upgraded from Swift 1.x to 2.0, Xcode gave a warning that the return value from map was unused. So I assigned it with let x = ...
and I got another warning:
So I let Xcode fix the warning for me, and it gave me this:
_ = self.buttons.map { $0.removeFromSuperview() }
What is the significance of an underscore when not in the context of a method parameter? What does it mean?
I do know that when a method parameter is anonymous, the underscore takes their place. I'm talking about an underscore in the middle of a method. It's not part of a message.