5 Replies Latest reply on Aug 1, 2017 9:19 AM by Alberto Gatta

    iOS / Swift, the SDK, and ZPL

    Art Hayes

      Hi,

       

      We bought a ZQ520 to investigate integrating it into an ad-hoc iPad app we're building to print a variety of custom receipts.   If it works to our satisfaction we'll be rolling out dozens of the printers.

       

      1. I'm wondering if anyone has an example of using the SDK within and iOS app with Swift while implementing a Bridging Header?  I've used plenty of Bridging Headers in the past, but the documentation surrounding using the SDK in a modern Swift environment is non-existent.  In the SDK there's a mountain of header files in the /include directory, but I'm not sure which headers to import in the Bridge file. 
      2. EDIT: I'd figured out the ZPL side of things if someone could help with the bridging question above.

       

      Any hints or pointers would be greatly appreciated.

       

      Thanks.

        • Re: iOS / Swift, the SDK, and ZPL
          Anil Santo

          Hi

           

          I had build an app recently in swift for Zebra Printer iMZ320 to meet my requirements i had included these header in the Bridging Header i think this might be sufficient for all zebra printers.

           

           

          #import "ZebraPrinterConnection.h"

          #import "ZebraPrinter.h"

          #import "ZebraPrinterFactory.h"

          #import "TcpPrinterConnection.h"

          #import "MFiBtPrinterConnection.h"

          #import "SGD.h"

          3 of 3 people found this helpful
            • Re: iOS / Swift, the SDK, and ZPL

              Hello Anil,

               

              Zebra does not currently have sample or documentation around using the Link-OS SDK with Swift. From my searching it appears that XCode will create the bridging header automatically for you or you can opt to do it manually. Please see this link for information on creating the bridging header. Please let me know if this answers your question.

               

              Thank you,

              Beverly

              • Re: iOS / Swift, the SDK, and ZPL
                Art Hayes

                Thanks Anil - those are the libraries I needed.

                 

                I did, however, have to put them in this particular order:

                 

                #import "MFiBtPrinterConnection.h"

                #import "ZebraPrinterConnection.h"

                #import "ZebraPrinter.h"

                #import "ZebraPrinterFactory.h"

                #import "TcpPrinterConnection.h"

                #import "SGD.h"

                 

                Swift 2.2 / Xcode 7.3.1

              • Re: iOS / Swift, the SDK, and ZPL
                James Landers

                Art,

                Were you able to actually create a working example of printing from swift using the bridge file.  I have a QLn320 and I am trying to find some swift code that gives some examples how this is done.  Fairly new to swift so not really clear how to leverage the Objective C classes in Swift.

                 

                Any pointers or anything you can share?

                 

                Any help is appreciated.  Thank you