Barcode Scanning / iOS

[quote=201528:@Jason King]Hi Edwin, that class has been updated in iOSKit. …
https://github.com/kingj5/iOSKit
Jason[/quote]

Hey Jason,
I downloaded the zipfile from Github. But I have no clue what to do next. Dragging the items into my project doesn’t really work.

Hi Edwin, once you download the zip, open the iOSKit.xojo_project file. This will open the project. Then to add the classes to your project select the Modules folder and copy and paste it into your project. Then you should be good to go.

As for core location, @Antonio Rinaldi posted a (complete) project with it in the stickies IOS Declares thread, and I posted a more basic project here with some important information spread through several responses afterwords on their use.
https://forum.xojo.com/conversation/post/168291

Hopefully this helps,
Jason

Has the source code for this and the attendee XDC app been released yet? We have an immediate need for both to scan barcodes for our bulk buy of Macs and for one of our annual MacAdmin conferences.

Yes look at the AVFoundation module in iOSKit:

https://github.com/kingj5/iOSKit

[quote=242812:@Jason King]Yes look at the AVFoundation module in iOSKit:

https://github.com/kingj5/iOSKit[/quote]

Will do, thanks.

It is possible to change AVCaptureLayerPreview (for barcode scanner) orientation to Landscape?

Not sure I understand. It should work in landscape? Does it not?

My app is locked to landscape and the preview of camera is rotated to 90°. If i rotate the tablet, the preview is right but my app doesn’t support portrait view.

Ah. You’ll need an affine transform to rotate it I believe. Try (untested). Add the structure to the view with fields as specified. If it rotates the wrong way make it -pi/2 instead.

[code]Structure CGAffineTransform
X0 as single
Xx as single
Xy as single
Y0 as single
Yx as single
Yy as single
End structure

Const pi = 3.14159
Declare function CGAffineTransformMakeRotation lib “CoreGraphics” (angle as float) as CGAffineTransform
Declare sub setTransform lib “UIKit” selector “setTransform:” (obj_id as ptr, transform as CGAffineTransform)
SetTransform(MyView.Handle, CGAffineTransformMakeRotation(pi/2))[/code]

Thank you. Works fine!