Skip to content

TMS Software blog: Two lines of code to add QR, UPC, EAN code scanning to your iOS Delphi apps

I love it when I can write fewer lines of code and get something done in my applications. I love it even more if I only have to write one or two lines of user-written code to add major functionality to my applications. Here is a cool blog post by TMS Software showing you how you can add barcode scanning (QR, UPC and EAN codes) to your Delphi iOS projects using just two lines of code!!! The TMS iCL component pack provides Delphi components integrate with iOS APIs and in this case, specifically leverage the ZBar open source project.

Two lines of user-written code to add QR, UPC, EAN code scanning in iOS Delphi applications

Read the Blog post -
Uses the TMS iCL component pack -

Here is the code listed in the blog post:

procedure TForm1136.Button1Click(Sender: TObject);
  // line1: activate the code scanner. This shows the camera that should be aimed at the QR or UPC

procedure TForm1136.TMSFMXZBarReader1GetResult(Sender: TObject; AResult: string);
  //line 2: the OnGetResult event is triggered when the code was retrieved and this returns it as a text
  ListBox1.Items.Insert(0, AResult);

The blog post also lists a link to the sample project code -

I love it! Way to go TMS Software, one our premier Embarcadero Technology Partners!

Bad Behavior has blocked 2193 access attempts in the last 7 days.