在Xcode 10.1 中使用 Swift 5(转)

2019-08-12  本文已影响0人  SK丿希望

因为我使用的是黑苹果 10.13.6 不支持安装Xcode 10.2,黑苹果升级系统又太麻烦,所以只能想了个办法让Xcode 10.1支持Swift 5.

操作步骤

1.下载Swift 5.0 Development Branch Toolchain。


2.安装

3.在Xcode.app中 将Swift.xcspec文件复制出来修改 修改完成替换

路径: /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/Swift.xcspec
       SupportedLanguageVersions = ( 
            3.0,            
            4.0,
            4.2      
        );        
        LanguageVersionDisplayNames = {            
            3.0 = "Swift 3";            
            4.0 = "Swift 4";            
            4.2 = "Swift 4.2";       
        };
        //添加以下
        SupportedLanguageVersions = ( 
            3.0,            
            4.0,
            4.2,
            5.0        
        );        
        LanguageVersionDisplayNames = {            
            3.0 = "Swift 3";            
            4.0 = "Swift 4";            
            4.2 = "Swift 4.2";            
            5.0 = "Swift 5.0";        
        };

4.使用

来源:传送门

上一篇 下一篇

猜你喜欢

热点阅读