Xcode 6.1 Swift Extensions - SourceKit Service Crash

↘锁芯ラ 提交于 2019-12-11 02:37:34

问题


I am trying to add an extension to Swift so I can format Doubles as found in this answer here

Precision String Format Specifier In Swift

Not ideal, but best solution I can find so far. However I cannot seem to add extensions to my project. Extensions work fine on playground, but when I try to add it to my project, I get the SourceKit service crash error every time I try to add the code in. I also get an error stating "declaration is only valid at file scope".

I have not previously used extensions in Swift before, so I cannot tell if this is directly related to Xcode 6.1 update or not.

Has anyone else had this issues or know anyway to solve this?


回答1:


The SourceKit service crash error is pretty annoying and doesn't only happen with Extensions. I have found breaking your project up into different files has helped.



来源:https://stackoverflow.com/questions/26672777/xcode-6-1-swift-extensions-sourcekit-service-crash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!