Xcode 6.1 Swift Extensions - SourceKit Service Fails

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

Precision String Format in Swift

Not perfect, but the best solution I can find so far. However, I cannot add extensions to my project. Extensions work fine on the playground, but when I try to add it to my project, I get a SourceKit service crash error every time I try to add code. I also get the error message "Ad is only valid in the file area."

I have not used extensions in Swift before, so I can’t say whether this is directly related to the Xcode 6.1 update or not.

Has anyone else had these problems, or did they manage to solve it anyway?

+2
source share
1 answer

The SourceKit service failure error is quite annoying and happens not only with Extensions. I found that splitting your project into different files helped.

+2
source

Source: https://habr.com/ru/post/977973/


All Articles