[swift-evolution] Remove forEach?

Brent Royal-Gordon brent at architechies.com
Tue Dec 8 16:47:53 CST 2015

> As long as the `for` loop is in the language, I don’t really see the use of `forEach`.

Here’s a typical use of forEach for me:


Seriously. I have one unreleased app which generates an entire software keyboard like that.

You could write it like:

	for subview in generateABunchOfSubviews() {

But why use the extra lines and temporary variable when you don’t have to?

Brent Royal-Gordon

More information about the swift-evolution mailing list