How to find out which version of Swift is installed on my Mac and in Xcode?
Hi everyone! I'm a beginner iOS developer and I'm confused about Swift versions. I installed the latest version of Xcode, but I often see code examples online that only work on a specific version of Swift. For example, I'm trying to use `#warning` for TODO markers, but Xcode complains:
```swift
#warning("Finish implementing the authorization logic")
// Error: 'warning' is only available in Swift 4.2 or newer
```
I don't understand which version of Swift I'm using. In the terminal, I type `swift --version`, but it shows some number like "5.10", and in Xcode settings it says "Swift 5" — is that the same thing? Also, if I open an old project written in Swift 3, will it work on my version of Swift? Please explain how to accurately determine the version of Swift used in my project.
No answers yet.
Log in to leave an answer
Blogs
Regular Expressions in PHP: A Complete Guide with Examples
Working with Dates and Time in Go: Advanced Techniques and Optimization
Advanced C++ Application Monitoring: Metrics and Alerts
How to pass Kotlin Array to Java varargs: a complete guide for beginners