How can I use Swift 2.3 in XCode 8 Playgrounds?

Misha Svyatoshenko picture Misha Svyatoshenko · Jun 16, 2016 · Viewed 8.3k times · Source

I have my playground project written in Swift 2.2 and I want take advantage of timeline visuals and try new debug features introduced in Xcode 8 beta. By default, Xcode 8 beta is using Swift 3 in Playgrounds and I cannot find a way to change that. Updating my code to Swift 3 is not an option unfortunately, because my code will be compiled on server with Swift 2.2 environment.

Answer

Performat picture Performat · Jul 12, 2016

Unfortunately, according to Apple it is impossible:

For instance, Playgrounds in Xcode only work with Swift 3, and notably the Swift Playgrounds app for iPad also uses Swift 3. Xcode project templates all use Swift 3, and all documentation is presented in a format appropriate for Swift 3.

More here.