Swift - Does not have a member named

92 Views Asked by At

I am trying to run a method from an api using this code

GTMagBarDevice.sharedDevice().startScan();

But I am receiving an error

'GTMagBarDevice' does not have a member named 'startScan'

Here is some of the code in the .h file I am bridging

@class GTMagBarDevice;

@protocol GTMagBarDeviceDelegate <NSObject>
@required
- (void)magbarDevice:(GTMagBarDevice*)device accessoryConnected:(BOOL)state;
- (void)magbarDevice:(GTMagBarDevice*)device componentFailed:(int)components;
@optional
// bEnabled means charging the iDevice is enabled
// bCharging means the MagBarDevice is currently charging itself
- (void)magbarDevice:(GTMagBarDevice*)device receivedBatteryStatus:(BOOL)bEnabled charging:(BOOL)bCharging voltage:(NSInteger)volts;
- (void)magbarDevice:(GTMagBarDevice*)device receivedBarcodeData:(NSString*)data barcodeType:(NSInteger)barcodeType;
- (void)magbarDevice:(GTMagBarDevice*)device scanDidTimeout:(BOOL)bAlwaysYes;
- (void)magbarDevice:(GTMagBarDevice*)device scanStarted:(BOOL)bStarted;
- (void)magbarDevice:(GTMagBarDevice*)device cardReaderReady:(BOOL)bReady;
- (void)magbarDevice:(GTMagBarDevice*)device swipeStarted:(BOOL)bAlwaysYes;
- (void)magbarDevice:(GTMagBarDevice*)device receivedMagneticStripeData:(NSDictionary*)data;
- (void)magbarDevice:(GTMagBarDevice*)device receivedBadStripeData:(BOOL)bAlwaysYes;
- (void)magbarDevice:(GTMagBarDevice*)device ignoredSwipe:(BOOL)bAlwaysYes;
- (void)magbarDevice:(GTMagBarDevice*)device firmwareUpdateAvailable:(NSString*)newVersion fromVersion:(NSString*)currentVersion;
- (void)magbarDevice:(GTMagBarDevice*)device physicalButtonPressed:(BOOL)bAlwaysYes;
- (void)magbarDevice:(GTMagBarDevice*)device physicalButtonReleased:(BOOL)bAlwaysYes;

@end

@interface GTMagBarDevice : NSObject {
    BOOL accessoryAttached;

    id<GTMagBarDeviceDelegate> delegate;
}

+ (GTMagBarDevice *)sharedDevice;

- (void)startScan;

@property (nonatomic, readonly) BOOL accessoryAttached;
@property (nonatomic, assign) id<GTMagBarDeviceDelegate> delegate;
@end
0

There are 0 best solutions below