ApolloZhu/swift_qrcodejs
QRCodeSwift: cross-platform/watchOS QRCode generator in Swift (without CIFilter)
Installation
<details> <summary><strong>Swift Package Manager</strong></summary>
<details> <summary>with Xcode</summary>
More details in the Official Guide, but in general:
- Select in the menu bar of Xcode:
File>Swift Packages>Add Package Dependency - Enter https://github.com/ApolloZhu/swift_qrcodejs.git
- Next, specify the version resolving rule as "Up to Next Major"
- Finish with choosing
QRCodeSwiftlibrary and add it to your app target.
</details>
<details> <summary>with <code>Package.swift</code></summary>
dependencies: [
.package(url: "https://github.com/ApolloZhu/swift_qrcodejs.git", from: "2.2.2"),
]... then add QRCodeSwift module/target from package swift_qrcodejs as your dependency.
</details>
</details>
<details> <summary><strong>CocoaPods</strong></summary>
pod 'swift_qrcodejs', '~> 2.2.2'</details>
<details> <summary><strong>Carthage</strong></summary>
I assume you know what you are doing (because I don't), but you probably need something like this:
github "ApolloZhu/swift_qrcodejs" ~> 2.2.2Note that Carthage doesn't work with Xcode 12 (but here's a workaround).
</details>
<details> <summary><strong>Manually</strong></summary>
Add all the .swift files from the Sources folder into your project.
</details>
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
- QRCodeSwiftCLI: lightweight command line tool to generate QRCodes.
- EFQRCode: popular Swift framework that generates stylized QRCode images.
- Apple Watch Bilibili: login onto bilibili with QRCode.
License
MIT License. Modified based on qrcodejs. See LICENSE and each individual file header for more information.
Package Metadata
Repository: ApolloZhu/swift_qrcodejs
Homepage: https://apollozhu.github.io/swift_qrcodejs/
Stars: 33
Forks: 11
Open issues: 1
Default branch: main
Primary language: swift
License: MIT
Topics: cli, generator, hacktoberfest, ios, linux, macos, macosx, osx, qrcode, qrcode-generator, swift, tvos, ubuntu, watchos
README: README.md
Archived: yes