Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Xcode Playground's to particular Swift Version?

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.

like image 752
sparrowceg Avatar asked Jan 31 '19 07:01

sparrowceg


People also ask

How do I specify Swift version in Xcode?

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.

How do I upgrade my version of Swift?

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.


1 Answers

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

like image 58
teodik abrami Avatar answered Nov 23 '22 10:11

teodik abrami