Issue #76 29 Jun 2017
Written by: Garric Nahapetian
It was a busy week on the main apple/swift repo. Here are some stats from GitHub Insights:
Excluding merges, 39 authors have pushed 156 commits to master and 284 commits to all branches. On master, 401 files have changed and there have been 12,589 additions and 9,215 deletions..
It’s great to see so much work being done so soon after WWDC. The core team and other contributors are making significant progress on the road to the official Swift 4 launch.
iOS 11 beta 2, tvOS 11 beta 2, and Swift Playgrounds 2 beta 2 were all released. Download them here, and keep filing radars!
Go from junior to senior developer in just a week, with the experts who have taught iOS from the very beginning.
In Episode 17: Testing in Swift, Jesse and JP discuss how Swift and its set of open source tools are tested to ensure that every release breaks as little as possible. 😜
News and community
Greg Heo wrote a post that looks at how Swift
Encodable work. There’s been a lot of open source activity related to this new feature, so understanding how it works will help when trying to digest related PRs.
Matt Godbolt’s Compiler Explorer now supports Swift.
David Owens released a preview for an extension to Visual Studio Code that supports Swift.
Commits and pull requests
Ben Cohen opened a pull request to add Substring affordances to
Hashable containers (See below for mailing list discussion).
Joe Groff merged a pull request that adds support for optional chaining / force unwrapping when dealing with KeyPaths.
The manual displayed when running
man swift on the command line has been updated.
David Farler merged a pull request that upstreams Apple’s (previously) internal index-while-building changes released with Xcode 9.
If you ever wonder what the details are for a
rdar:// that a particular PR fixes, feel free to ask.
Proposals in review
Using an operator to provide feedback on the context of a failed unwrap has become a commonly implemented approach in the Swift developer Community. What are your thoughts about adopting this widely-used operator into the standard library?
Ben Cohen made a pitch regarding
Substring performance affordances.
As outlined in SE-0163, the more general question of implicit conversion from
Stringwas deferred pending feedback on the initial implementation. To date, the feedback we’ve received hasn’t suggested that such an implicit conversion is necessary — that migrations from 3.2 to 4.0 haven’t led to an extensive need to perform
Stringconversion. Any further input, either on or off list, about this particular aspect of migration would be very gratefully received.
Itai Ferber sent a message on Swift-Evolution asking for feedback regarding SE-0166 and SE-0167 and letting the community know that suggestions have already been implemented and will continue to be considered.
Robert Bennett made an interesting pitch for declaring
let in protocols. I didn’t realize this problem existed.
I’m bumping into an annoying problem with protocols. In a
structit is common to have a
letinstance variable and assign it in
init. Unfortunately there is no way to translate this into a protocol with
initin an extension.
Taking can sometimes feel as good as giving.