Expected ';' at end of declaration list SDK 0.11.2

I having been trying to merge the sample scanner code into existing Swift 5 project. i seems to be stuck on Expected ‘;’ at end of declaration list.

. I have added screeshot as well. Has any one faced similar issue. Thanks.

Hi @hassanrazakhalid

The sample code is all in Objective-C, not Swift, so you can’t just copy and paste code like that; the syntax is completely different.

For instance, your first line:

const GLKVector3 initVolume = GLKVector3Make (0.5f, 0.5f, 0.5f);

Converts to this in Swift:

let initVolume = GLKVector3Make(0.5, 0.5, 0.5)

You may find it easier to look at the ported version here: Swift 5 SDK 0.9 Opensource Scanner Port by @n6xej as a starting point.

Another useful tool may be https://objectivec2swift.com/#/converter/code/

-Andy W

Yes but I am treating these files as Objective C files and not swift files. And using bridging header I am importing ViewController.h .Shouldn’t this work. I will look into provided links as well.