Working with multiple Swift versions in Xcode

I recently ran into an issue in Xcode where I downloaded a sample repository for a project, and followed the instructions listed in the repository’s README file. Only to find out that one of the included libraries was built using a prior version of Swift then the version installed with my version of Xcode. That’s really frustrating considering that maintaining multiple versions of Xcode can be quite a pain, as with maintaining multiple copies of anything.

The good news is, instead of having to try and maintain multiple versions of Xcode, we can use something called Xcode toolchains. You can download a prior version of Swift, and then install it on macOS as an administrator, and then after restarting Xcode, if it was open, will then have a new menu option to switch toolchains.


First step is to visit https://swift.org/download/#releases and choose the version of Swift you want, click the Toolchain link to download the package, then install it on macOS (OSX). After installation is complete, you can open Xcode, restarting first if need be, and then clicking on Xcode menu option, and there should now be a Toolchains menu option as seen in screenshot below.

After selecting your desired toolchain, you can now build those projects whose dependent libraries were built using another version of Swift than your current version of Xcode came preinstalled with!

You can also find the different toolchains under Xcode > Preferences > Components if you wish to remove it. Hope this helps someone like it helped me!


If you found this article to be of help, please don’t forget to give as many claps as you believe it should have, and follow my blog if you are interested in seeing more like it!

Rocky Top Solutions Blog

Tutorials on software development, analytics, web and mobile development, SEO, and other technology related tutorials

Rocky Top Solutions

Written by

Service Disabled Veteran Owned Small Business providing custom website and mobile app development services, SEO services, and technology consulting.

Rocky Top Solutions Blog

Tutorials on software development, analytics, web and mobile development, SEO, and other technology related tutorials

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade