I was able to see an interesting case using Estimote nearables SDK
They have a class ESTNearable
with property called zone
.
// ENUM
typedef NS_ENUM(NSInteger, ESTNearableZone ) {
ESTNearableZoneUnknown = 0,
ESTNearableZoneImmediate,
ESTNearableZoneNear,
ESTNearableZoneFar,
};
// CLASS
@interface ESTNearable : NSObject <NSCopying, NSCoding>
// ...
@property (nonatomic, assign, readonly) ESTNearableZone zone;
// ...
@end
So when I try to use this method in Swift, compiler fails with that error:
As I understand there is some kind of compiler bug and for some reason it believes that I want to use old zone
method from NSObject
- (struct _NSZone *)zone OBJC_ARC_UNAVAILABLE;
I can use other specific properties of that class without any problems.
As I use an SDK I can not change the name of the zone
method. I believe I can write some kind of obj-c category, add some new method there, which will return value of original one, but I do not want to add obj-c classes in my project.
Is there any possibility to call this method from swift as I believe correct zone
method will be called for class instances?
Thanks in advance!