Migration Procedures from v1.0.0

Changed supported OS versions of the methods in StarPrinter class

The supported OS versions of the methods of StarPrinter class have changed from StarXpand SDK v2.0.0.

  • Following methods that use async are available in iOS 13 and later.

Methods

v1.0.0

v2.0.0

open() async

iOS 15 or later

iOS 13 or later

print(command:) async

iOS 15 or later

iOS 13 or later

print(raw:) async

iOS 15 or later

iOS 13 or later

getStatus() async

iOS 15 or later

iOS 13 or later

close() async

iOS 15 or later

iOS 13 or later

  • Following methods that take completion as an argument are now supported only in iOS 12.

    • When using on iOS 13 and 14, please refer to “Migration Procedures” section.

    • If used on iOS 13 or later, the build will succeed but a runtime error will occur.

Methods

v1.0.0

v2.0.0

open(completion:)

iOS 12 - 14

iOS 12

print(command:completion:)

iOS 12 - 14

iOS 12

print(raw:completion:)

iOS 12 - 14

iOS 12

getStatus(completion:)

iOS 12 - 14

iOS 12

close(completion:)

iOS 12 - 14

iOS 12

Migration Procedures

Change the parameter of #available() from iOS 15.0 to iOS 13.0 as follows.

//if #available(iOS 15.0, *) {   // <-- v1.0.0
if #available(iOS 13.0, *) {     // <-- v2.0.0 or later
    Task {
        do {
            try await printer.open()

            // ...
        }
    }
} else {
    printer.open(completion: { error in
        // ...
    })
}