This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1301598-what-s-new-in-swift-5-syntactical-sugar
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1301598-what-s-new-in-swift-5-syntactical-sugar
I think that on line 16 of the playground there is a filter method call missing.
let olderPlayers = playerAges.filter({ $0 > 12 }).count
It would be convenient if the downloadable materials were edited accordingly.
1 Like
@armdevp Thanks very much for pointing this out to us, I will pass this along to the author.
Hi @armdevp - this is actually some leftover code due to a last minute change in what shipped with Swift 5 - the count(where:) method was removed! I do hear it is supposed to return in Swift 5.1. I have already submitted an updated playground fo posting to the page for screencast, so it should be there soon. Thanks for bringing this to our attention, and thanks for watching!
1 Like