如何同时使用 swift 2 和 swift 3?

How can I use swift 2 and swift 3 at the same time?

虽然swift3已经发布了,但是我现在还不想更新我的代码,因为我用的很多CocoaPods还在swift2,我不知道迁移者将对那些 pods 做什么。会不会一直不变,导致项目无法构建成功?或者它们也会迁移到 Swift 3?我不知道!

另一方面,我真的很想尝试一下 Swift 3 中的新语法和其他新功能。它们看起来真的很酷!

如何使用 Swift 2 继续开发我现有的项目,但对于其他项目,使用 Swift 3 编译?

换句话说,如何为项目选择编译器?

How can I continue developing my existing projects with Swift 2, but for other projects, compile with Swift 3?

同时安装 Xcode 7(其中有 Swift 2)和 Xcode 8(对于 Swift 3)并使用 xcode-select 命令行工具在它们之间切换。