I made an Xcode playground that lets you try out many of the new features coming in Swift 4. You can download it on GitHub.
The cool thing is that you can run the playground right now in Xcode 8.3; you donʼt have to wait for the first official Swift 4.0 beta, which will probably come as part of Xcode 9 at WWDC. All you need to do is install the latest Swift snapshot from swift.org (donʼt worry, itʼs easy).
- Go to the snapshots download page on swift.org and download the latest snapshot for Xcode.1
- Run the installer to install the snapshot.
In Xcode, go to Xcode > Toolchains > Manage Toolchains… and select the snapshot. It might be a good idea to quit and relaunch Xcode after switching snapshots. I had occasional problems with syntax highlighting and error reporting, and a relaunch fixed them.
I plan to keep the playground up to date over the summer as Swift 4.0 matures and more features get implemented.
You can choose between two branches: Trunk Development (the master branch) and Swift 4.0 Development. I recommend the latter because thatʼs the branch the final Swift 4.0 release will be made from. ↩︎