Sample Code

Sample code is provided with the SDK under the Demos directory. Two Swift samples are provided.

Drop-In View Controller

Drop-In View Controller demonstrates the quickest implementation path for applications using DMSDetectorViewController. A detector view controller manages all the devices and setup for developers, so all a developer needs to do is display the view controller and register for results. Detector view controllers can even be integrated directly into a storyboard. Custom UI can be added alongside the Drop-In View Controller, and default UI chrome can be hidden.

If the Drop-In View Controller is displayed by embedding it within a container view controller, certain UI elements will not display (such as the torch button).


More complicated or custom applications might require unique user experiences. DMSDemo shows how to integrate the DMSDK into custom or existing camera and audio applications. It integrates DMSVideoCaptureReader and DMSAudioCaptureReader with an AVFoundation session, and also shows how to find out more information about content through the Digimarc Barcode Resolver using DMSResolver. DMSDemo draws best practices from Apple’s AVCam sample, which is another good demonstration of how to drive the camera with AVFoundation.