Adding a (convenient) computed height
property to UIView
in my UIViewExtension.swift
file is causing the Swift compiler to segfault...
I’ve discovered a simple workaround until the problem is fixed in a future Xcode/Swift build:
.swift
file that it’s being used.In the example project you provided, place the contents of UIViewExtension.swift
and CALayerExtension.swift
above AppDelegate.swift
Hopefully this can get us to write working Swift code until the problem’s cleared up.
As for me, adding private
to static var fixed clang crash:
private static var taskId = 0
In my case, this error because I use Class name for variable
var MYClass : MYClass {
get {
return.....
}
}
And this fixes my problem
var myClass : MYClass {
get {
return.....
}
}
For me the issue was having my architectures not set to the standard. I had added i386 or something, just set it back to default xcodeproject arch and it compiled fine.
I had a compiler segmentation fault on a statement like this:
someFunction(isFlagged ? "String1" : "String2")
I just did a if-else statement instead and it works.
As others wrote above, for me this happened when I'm using an extension over a protocol but the signature of methods in the protocol don't match the implementations in an extension.
In my case, I had added a new parameter to the implementation (in the extension) but forgot to also add it to the method's signature in the protocol.