Xcode 6.1 Swift Extensions - SourceKit Service Cra

2019-07-15 14:20发布

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?

标签: swift xcode6
1条回答
霸刀☆藐视天下
2楼-- · 2019-07-15 15:05

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.

查看更多
登录 后发表回答