# EFQRCode **Repository Path**: eyrefree/EFQRCode ## Basic Information - **Project Name**: EFQRCode - **Description**: EFQRCode 是一个轻量级的、用来生成和识别二维码的纯 Swift 库,可根据输入的水印图和图标产生艺术二维码,基于 CoreGraphics、CoreImage 和 ImageIO 进行开发。EFQRCode 为你提供了一种更好的在你的 App 中操作二维码的方式,它能够运行于 iOS、macOS、watchOS 和 tvOS 平台,并且支持通过 CocoaPods、Carthage 和 Swift Package Manager 获取。 - **Primary Language**: Swift - **License**: MIT - **Default Branch**: main - **Homepage**: https://github.com/EFPrefix/EFQRCode - **GVP Project**: No ## Statistics - **Stars**: 21 - **Forks**: 6 - **Created**: 2017-04-05 - **Last Updated**: 2025-08-11 ## Categories & Tags **Categories**: barcode **Tags**: None ## README 
EFQRCode is a lightweight, pure-Swift library for generating stylized QRCode images with watermark or icon, and for recognizing QRCode from images, inspired by [qrcode](https://github.com/sylnsfar/qrcode) and [react-qrbtf](https://github.com/CPunisher/react-qrbtf). Based on `CoreGraphics`, `CoreImage`, and `ImageIO`, EFQRCode provides you a better way to handle QRCode in your app, no matter if it is on iOS, macOS, watchOS, tvOS, and/or visionOS. You can integrate EFQRCode through CocoaPods, Carthage, and/or Swift Package Manager. ## Examples ||| :---------------------:|:---------------------:|:---------------------:|:---------------------: ||| ||| ## Demo Projects ### App Store You can click the `App Store` button below to download demo, support iOS, tvOS and watchOS:
##### 3.2 Generation from animated images
You can create a dynamic QR code by passing in a sequence of animated images. The usage method is as follows:
```swift
let generator = try? EFQRCode.Generator("https://github.com/EFPrefix/EFQRCode", style: .image(
params: .init(image: .init(image: .animated(images: cgImages, imageDelays: cgImageDelays))))
)
if let imageData = try? generator?.toGIFData(width: 512) {
print("Create QRCode image success \(imageData)")
} else {
print("Create QRCode image failed!")
}
```
You can get more information from the demo, result will like this:
##### 3.3 Exportable types
- Static: NSImage, UIImage, PDF, PNG, JPEG
- Animated: APNG, GIF, SVG, MOV, MP4, M4V
#### 4. Next
Learn more from [DeepWiki](https://deepwiki.com/EFPrefix/EFQRCode).
## Recommendations
1. Please select a high contrast foreground and background color combinations;
2. To improve the definition of QRCode images, increase `size`;
3. Oversized generation dimensions, excessive QR code content, and overly large imported media may lead to generation failures;
4. It is recommended to test the QRCode image before put it into use;
5. Any contributing and pull requests are warmly welcome;
6. Part of the pictures in the demo project and guide come from the internet. If there is any infringement of your legitimate rights and interests, please contact us to delete.
## Contributors
- Thanks for the help from JetBrains's [Open Source Support Program](https://www.jetbrains.com/community/opensource/?from=EFQRCode).