2. How to add the library — StarPRNT SDK Users Manual 1.5.0 documentation

If using a StarIODeviceSetting.xcframework, add also a StarIO.xcframework to “Link Binary With Libraries”.

Add StarIODeviceSetting.xcframework to “Link Binary With Libraries” on the Build Phases tab.

Add StarIO_Extension.xcframework to “Link Binary With Libraries” on the Build Phases tab.

Add StarIO.xcframework to “Link Binary With Libraries” on the Build Phases tab.

Please refer to Podfile in SDK for the latest library version.

Please download and confirm the newest SDK and Library from our Global Support Site .

Library supports CocoaPods and Framework.Please link library that suits your application configuration.

When using Ethernet printer on iOS14 or later

When using Bluetooth Low Energy printer on iOS13 or later

Please do not apply this, if you are not using Bluetooth ineterface.

2.3. Add Objective-C Bridging Header¶

Development with Swift

Frameworks included in the iOS StarPRNT SDK are written in Objective-C. To use them in Swift, you need to add Objective-C Bridging-Header to your project.

  1. Select File – New – File… from Xcode menu.

  2. Select the Header File , and then click Next .

  3. Enter a name and click Create to create an empty header file. In the example shown below, the header file name is “StarIO_Extension-Bridging-Header.h”.

  4. Write the following import lines in the header file created.

    #import <StarIO/SMPortSwift.h>

    #import <StarIO_Extension/StarIoExt.h>

    #import <StarIO_Extension/StarIoExtManager.h>

    #import <StarIO_Extension/SMBluetoothManagerFactory.h>

    #import <StarIO_Extension/SMSoundSetting.h>

    // To use StarIODeviceSetting.xcframework, you also need to write the following lines.

    #import <StarIODeviceSetting/StarIODeviceSetting.h>

  5. Specify the path to the created header file at Objective-C Bridging Header of Build Settings.

../_images/configure_application_objective-c_bridging_header.png

Then, you can use frameworks in Swift.