Skip to content

As the original author has archived the project, we have forked it for continued maintenance.

License

Notifications You must be signed in to change notification settings

EFPrefix/swift_qrcodejs

 
 

Repository files navigation

QRCodeSwift (swift_qrcodejs)

Latest Release MIT License Swift 5.0+ Compatible with All Platforms

Documentation Code Coverage CocoaPods Compatible Swift Package Manager Compatible Carthage Compatible

Cross-platform QRCode generator written in pure Swift, aiming to solve the awkward situation that there's no CIFilter for QRCode generation on Apple Watches.

Installation

Swift Package Manager
with Xcode

More details in the Official Guide, but in general:

  1. Select in the menu bar of Xcode: File > Swift Packages > Add Package Dependency
  2. Enter https://github.com/ApolloZhu/swift_qrcodejs.git
  3. Next, specify the version resolving rule as "Up to Next Major"
  4. Finish with choosing QRCodeSwift library and add it to your app target.
with Package.swift
dependencies: [
    .package(url: "https://github.com/ApolloZhu/swift_qrcodejs.git", from: "2.3.0"),
]

... then add QRCodeSwift module/target from package swift_qrcodejs as your dependency.

CocoaPods
pod 'swift_qrcodejs', '~> 2.3.0'
Carthage

I assume you know what you are doing (because I don't), but you probably need something like this:

github "ApolloZhu/swift_qrcodejs" ~> 2.3.0

Note that Carthage doesn't work with Xcode 12 (but here's a workaround).

Manually

Add all the .swift files from the Sources folder into your project.

Usage

import QRCodeSwift

guard let qrCode = try? QRCode("Hello World!") else {
    fatalError("Failed to generate QRCode")
}
print(qrCode.toString(filledWith: "##", patchedWith: "  "))

For more, checkout the documentation.

Example Projects

License

MIT License. Modified based on qrcodejs. See LICENSE and each individual file header for more information.

About

As the original author has archived the project, we have forked it for continued maintenance.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 95.7%
  • Objective-C 1.8%
  • Ruby 1.4%
  • Shell 1.1%