I tried a swift code that's working well in the playground but not in Xcode project. So I want to know how to change a Playground's particular swift version.
It can be done using Xcode, Go to Xcode->Preferences->Components-> Toolchains section and Select the Swift. 3.1. 1 snapshot, this will set the new Swift version for the local Xcode. You may need to restart Xcode.
You can also update every single Swift Package in your project at once. To do this, open the Files menu, navigate to Packages and then click Update to Latest Package Versions. Afterwards, make sure to test your project to see if everything still works, especially in projects with a lot of package dependencies.
sorry but you can't apple documentation says playground only run on latest swift version on your xcode
Note: Swift Playgrounds 2.2 uses Swift 4.2 (swiftlang-1000.0.37.1). Code written using other versions of Swift may not work in Swift Playgrounds 2.2.
for more read this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With