Skip to content

The libqrencode-swift is tiny Swift library for quick and simple generating QR codes. Especially to Server Side Swift.

License

Notifications You must be signed in to change notification settings

nikolay-kapustin/libqrencode-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libqrencode-swift

Swift 5.2+ Xcode 11.0+ Swift Package License

The libqrencode-swift is tiny Swift library for quick and simple generating QR codes. The main goal of creating this wrapper is using lib on the server side. If you backed form iOS or MacOS developing, you probably know that QR code generation is trivial. Unfortunately, we can't using powerful Core Graphics frameworks on server side in Swift. So if you move on to server side code, that way is not applicable.

Swift Package

Install

To integrate library into your code, use SPM

...
dependencies: [
.package(path: "https://github.com/digital-horizon/libqrencode-swift")
]
...

The library works well in Mac OS and Linux – anywhere the Swift toolchain is available.

Using

let str = "https://apple.com"
let colors:[Int] = [120,200,45] // you can optionally set color via components (or pass nil to black by default)

let result = QREncodeSwift.qr(from: str, level: .middle, outputFileName: "qr.png", colorComponents:nil)

if result == true {
    // check qr.png file here
}

And viola!

QR

License

The libqrencode-swfit is released under the MIT License.

About

The libqrencode-swift is tiny Swift library for quick and simple generating QR codes. Especially to Server Side Swift.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published