How to view the actual objc method signature in swift?

93 Views Asked by At

Example of code:

/**
 Device types.
 */
typedef NS_OPTIONS(NSUInteger, STDeviceType) {
/**
 The device is not defined.
 */
    STDeviceTypeNone = 0,
/**
 Real device.
 */
    STDeviceTypeHardware = 1 << 0,
/**
 A device simulator.
 */
    STDeviceTypeSimulator  = 1 << 1
};

@interface TestSwiftInterface : NSObject

+ (void)enableVisibilityErrorIndicatorForDeviceType:(STDeviceType)deviceType;

+ (void)enable2VisibilityErrorIndicatorForDeviceType:(YMADeviceType)deviceType;

@end

Where STDeviceType is a full copy of YMADeviceType from YandexMobileAds library and enableVisibilityErrorIndicatorForDeviceType is the same as enable2VisibilityErrorIndicatorForDeviceType (I add one number to one method name to avoid "duplication").

Xcode shows swift interface:

/**
 Device types.
 */
public struct STDeviceType : OptionSet {

    public init(rawValue: UInt)

    
    /**
     Real device.
     */
    public static var hardware: STDeviceType { get }

    /**
     A device simulator.
     */
    public static var simulator: STDeviceType { get }
}

open class TestSwiftInterface : NSObject {

    
    open class func enableVisibilityErrorIndicator(for deviceType: STDeviceType)

    
    open class func enable2VisibilityErrorIndicator(forDeviceType deviceType: Any!)
}

In the same time code autompletion and compiler works with enable2VisibilityErrorIndicator as if it has signature:

open class func enable2VisibilityErrorIndicator(for deviceType: YMADeviceType)

There a lot of similar questions how to view objc method signature in swift but no one describes this situation. So how to view the actual method signature if "generated swift interface" is incorrect?

0

There are 0 best solutions below