When overriding in a Swift subclass of an Objective-C class, I get a message saying:
Property type 'BOOL' (aka 'bool') is incompatible with type 'Boolean' (aka 'unsigned char') inherited from 'ChildClass'
I tried to use Other Boolean types but it won't work.
Any idea how to properly override an Objc BOOL in Swift
Swift code (subclass):
override var myVar: Bool {
get {
return something ? true : myVar
}
set {
myVar = newValue
}
}
Objc Parent Declaration:
@property(atomic) Boolean isLoading;
Swift bridging header where the warning appear:
SWIFT_CLASS("_TtC6Module30ChildClass")
@interface ChildClass : ParentClass
@property (nonatomic) BOOL myVar; //<----- Here
@end