Added in Version 1.0.0

StarPrinter

The class that controls the printer

Constructor

init(_ connectionSettings: StarConnectionSettings)

Initialize object

Property

information

Printer information

connectionSettings

Printer connection settings

printerDelegate

Status event for the printer

drawerDelegate

Status event for the cash drawer

inputDeviceDelegate

Status event for an input device

displayDelegate

Status event for the customer display

openTimeout

Open timeout (msec)

printTimeout

Print timeout (msec)

getStatusTimeout

Get status timeout (msec)

Method (for iOS 13 or later)

open() async

Open the printer

print(command: String) async

Print (recommended)

print(raw: Data) async

Print

getStatus() async

Get the printer status

close() async

Close the printer

Method (for iOS 12)

open(completion: @escaping (Error?) -> Void)

Open the printer

print(command: String, completion: @escaping (Error?) -> Void)

Print (recommended)

print(raw: Data, completion: @escaping (Error?) -> Void)

Print

getStatus(completion: @escaping (StarIO10.StarPrinterStatus?, Error?) -> Void)

Get the printer status

close(completion: @escaping () -> Void)

Close the printer

Warning

Use the methods of this class depending on the OS version of the device you are running on. iOS 13 and later devices should use the Method (for iOS 13 or later), while iOS 12 devices should use the Method (for iOS 12).