Skip to content

Commit cb86ea5

Browse files
author
EugeneKlyuenkov
committed
fixed project struct and readme
1 parent f3a7bdb commit cb86ea5

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

GS1BarcodeParser.xcworkspace/contents.xcworkspacedata

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GS1BarcodeParser_Framework.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
6B6FC10428C9EE0D00C7F760 /* README.md */,
5555
6BD6F08C28CB30B900E5E7EB /* Shakuro.GS1BarcodeParser.podspec */,
5656
6BB6A4B928D4A9760006D7D1 /* .swiftlint.yml */,
57+
6B6FC11428C9F0B400C7F760 /* Source */,
5758
6B6FC0D728C9E8D900C7F760 /* GS1BarcodeParser_Framework */,
5859
5042595121338FAB4DAB60CF /* Pods */,
5960
6B6FC0D628C9E8D900C7F760 /* Products */,
60-
6B6FC11428C9F0B400C7F760 /* Source */,
6161
);
6262
sourceTree = "<group>";
6363
};

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
- [Usage](#usage)
1212
- [License](#license)
1313

14+
A `GS1BarcodeParser` provides parsing of GS1 Barcodes.
15+
Library also provides general purpose validator for barcode's content.
16+
1417
## Requirements
1518

1619
- iOS 11.0+
@@ -39,6 +42,19 @@ If you prefer not to use CocoaPods, you can integrate Shakuro.GS1BarcodeParser s
3942

4043
## Usage
4144

45+
### Parser
46+
47+
let barcodeParser = GS1BarcodeParser()
48+
barcodeParser.validation = .none // .soft, .hard
49+
var barcodeElements: [GS1Barcode.Element] = []
50+
51+
let barcode: String = "8017123456789012345678\u{1D}8018123456789012345678\u{1D}80191234567890"
52+
do {
53+
barcodeElements = try barcodeParser.parse(string: barcode).elements
54+
} catch let error {
55+
// handle error
56+
}
57+
4258
Have a look at the [GS1BarcodeParser_Example](https://github.com/shakurocom/GS1BarcodeParser/tree/master/GS1BarcodeParser_Example)
4359

4460
## License

0 commit comments

Comments
 (0)