SKScannersBrowser

@interface SKScannersBrowser : NSObject

Principal class to perform discovery of the scanners in the user’s network. Only Bonjour service discovery in a local network is currently supported. Discovery process is not time limited once started - so the client should be ready to receive one of device availability callbacks at any point of time after browsing is started.

  • Starts browsing scanner devices. Does nothing if browsing is already started. Performs calling the handlers on the receiver runloop.

    Declaration

    Objective-C

    - (void)startWithDidFindScannerHandler:
                (nullable SKScannersAvailabilityHandler)aFoundHandler
                   didRemoveScannerHandler:
                       (nullable SKScannersAvailabilityHandler)aLostHandler;

    Swift

    func start(didFind aFoundHandler: SKScannersAvailabilityHandler?, didRemove aLostHandler: SKScannersAvailabilityHandler? = nil)

    Parameters

    aFoundHandler

    A handler to be called once a device becomes available

    aLostHandler

    A handler to be called when a device becomes unavailable

  • Stops browsing if it was started. Otherwise does nothing.

    Declaration

    Objective-C

    - (void)stop;

    Swift

    func stop()
  • Indicates whether scanner browsing is in progress

    Declaration

    Objective-C

    @property (readonly, getter=isStarted, nonatomic) BOOL started;

    Swift

    var isStarted: Bool { get }
  • Scanners available currently

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSArray<SKScanner *> *scanners;

    Swift

    var scanners: [SKScanner]? { get }