I believe I found a small bug in Swift Compiler when used one third party SDK.
Basically I have some obj-c class with overriden zone method. Swift compiler doesn't compile
zone method as for some reason it assumes that I want to call zone method from NSObject, which can not be used in ARC environment.I believe problem exists for all methods marked with OBJC_ARC_UNAVAILABLE flag.
Here is an example:
@interface Test : NSObject
@property (nonatomic, readonly) NSString *zone;
@end@implementation Test
- (NSString *)zone {
return @"Test";
}
@endWhen I use this class in Swift I get Compiler error.
let test = Test()
test.zone()Error: 'zone()' is unavailable; not available in automatic reference counting mode
To make it work I added small category with new method.
@interface Test(Extended)
- (NSString *)testZone;
@end
@implemntation Test (Extended)
- (NSString *)testZone {
return self.zone;
}
@end