https://github.com/imryan/brocade
📦 Swift library for the free and open product database.
https://github.com/imryan/brocade
brocade database datakick gtin product product-database upc
Last synced: about 1 month ago
JSON representation
📦 Swift library for the free and open product database.
- Host: GitHub
- URL: https://github.com/imryan/brocade
- Owner: imryan
- License: mit
- Created: 2020-04-25T17:59:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T21:31:56.000Z (almost 6 years ago)
- Last Synced: 2025-02-22T03:03:17.703Z (over 1 year ago)
- Topics: brocade, database, datakick, gtin, product, product-database, upc
- Language: Swift
- Homepage: https://www.brocade.io/
- Size: 664 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📦 Brocade
Swift library for the free and open product database.
[](https://travis-ci.org/imryan/Brocade)
[](https://cocoapods.org/pods/Brocade)
[](https://cocoapods.org/pods/Brocade)
[](https://cocoapods.org/pods/Brocade)
## Usage
```swift
// List last 100 items using delegate
let brocade = Brocade(delegate: self)
brocade.listItems()
// List last 100 items using closure
brocade.listItems { (items, error) in
debugPrint("Items: \(items). Error: \(error?.localizedDescription).")
}
// Get item by code using delegate
let brocade = Brocade(delegate: self)
brocade.getItem(code: "00074887615305")
// Get item by code using closure
brocade.getItem(code: "00074887615305") { (item, error) in
debugPrint("Item: \(item.itemSummary). Error: \(error?.localizedDescription).")
}
// Search item by query using delegate
let brocade = Brocade(delegate: self)
brocade.searchItem(query: "milk")
// Search item by query using closure
brocade.searchItem(query: "milk") { (items, error) in
debugPrint("Items: \(items). Error: \(error?.localizedDescription).")
}
```
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.


## Installation
Brocade is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'Brocade'
```
## Author
Ryan Cohen, notryancohen@gmail.com
## License
Brocade is available under the MIT license. See the LICENSE file for more info.