Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran Fernandez committed Dec 9, 2017
1 parent db645c3 commit d0d8c36
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

This project intends to be a small wrapper around C++ code from https://github.com/nayuki/QR-Code-generator in order to be able to use it with Swift easily.

### Build it
#### Swift Package Manager
1. `git clone [email protected]:fjfdeztoro/Swift-QR-Code-generator.git`
2. `cd cd Swift-QR-Code-generator/`
3. `swift build && swift test`

#### With Xcode
All the steps from previous entry and:
1. `swift package generate-xcodeproj`
2. `open QRCodeGenerator.xcodeproj/`
3. `Select target: QRCodeGenerator-Package`
4. `Go to Build Settings for the project.`
5. `Select All`
6. `Look for Apple LLVM - Language - C++ section`
7. `Change C++ Language Dialect to C++11[-std=c++11]`
8. `Change C++ Standard Library to libc++`
9. `cmd+b`

### Use it
#### Resolving dependencies
In your `Package.swift` add this entry as a new dependency:
```
.package(url: "https://github.com/fjfdeztoro/Swift-QR-Code-generator.git", from: "0.0.2")
```

And in your target, add this dependency: `"QRCodeGenerator"`

#### Mixing it with your code.

```
import QRCodeGenerator
print(QRCodeGenerator.getQRCodeAsSVG("https://github.com/fjfdeztoro/Swift-QR-Code-generator/blob/master/README.md", withTolerance: .High))
```

That code will print the content of a SVG file that will contain a QR with a URL to this file.

![Demo screenshot][1]

## License
MIT License.

Expand All @@ -10,3 +49,5 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

* The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.

[1]: ./art/qr-to-readme.png
Binary file added art/qr-to-readme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d0d8c36

Please sign in to comment.