Skip to content

A SwiftUI view to enable camera to scan various types of data including dates and currency.

Notifications You must be signed in to change notification settings

rodyager/DataScanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

This is a simple project to demonstrate the SwiftUI DataButton struct and a Scanable protocol.

DataButton($scanable) provides a button to enable the camera to capture of value of scanable provided scanable conforms to the Scanable protocol.

Sample implementations are provided to make Date and Double conform to the Scanable protocol to scan dates and currency respectively.

The Scanable protocol requires three functions:

mutating func value(from: String) to transform the value of the Scanable to reflect the detected text.

func recognizedDataTypes() -> Set<DataScannerViewController.RecognizedDataType> to specify the kind of text or barcode that is to be detected and

func scanFormatted() -> String to provide a textual representation of the detected value for the user.

About

A SwiftUI view to enable camera to scan various types of data including dates and currency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages