Avatar ·

How to find out which version of Swift I have installed?

Hello! I just started learning Swift and Xcode, but I've already run into a problem. I downloaded the latest version of Xcode from the App Store, but when I write code, I'm not sure which version of Swift is actually being used. For example, I'm trying to use `async/await`, but the compiler gives an error: `'async' is only available in iOS 15.0 or newer`. Or I want to check if the `Result` type is supported. I open the terminal and try the command `swift --version`, it shows something like `Apple Swift version 5.9`. But in Xcode, when I create a new project, in Build Settings I see `Swift Language Version` — it's set to `5.0`. I'm confused. Which version is actually being used? Also, I heard that you can check the Swift version directly in code. Is that true? I need to make sure my code will work