{"id":1542,"url":"https://github.com/EFPrefix/EFQRCode","last_synced_at":"2025-08-13T07:33:46.269Z","repository":{"id":37484384,"uuid":"79902465","full_name":"EFPrefix/EFQRCode","owner":"EFPrefix","description":"A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.","archived":false,"fork":false,"pushed_at":"2023-09-02T13:03:16.000Z","size":144374,"stargazers_count":4536,"open_issues_count":19,"forks_count":475,"subscribers_count":88,"default_branch":"main","last_synced_at":"2024-04-14T01:00:16.917Z","etag":null,"topics":["barcode","barcode-generator","barcode-scanner","barcodes","generator","hacktoberfest","ios","macos","qrcode","qrcode-generator","qrcode-reader","qrcode-scanner","qrcodes","recognizer","swift","tvos","watchos"],"latest_commit_sha":null,"homepage":"https://efprefix.github.io/EFQRCode","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EFPrefix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["EyreFree","ApolloZhu"],"open_collective":"efqrcode","custom":"https://www.efqrcode.com/donations.jpg"}},"created_at":"2017-01-24T10:45:40.000Z","updated_at":"2024-04-13T02:57:35.000Z","dependencies_parsed_at":"2023-09-26T10:18:50.996Z","dependency_job_id":null,"html_url":"https://github.com/EFPrefix/EFQRCode","commit_stats":{"total_commits":441,"total_committers":21,"mean_commits":21.0,"dds":0.6712018140589568,"last_synced_commit":"5cc6cc0b03742b23d1958642210fbf23a20dac53"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFQRCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFQRCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFQRCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFQRCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EFPrefix","download_url":"https://codeload.github.com/EFPrefix/EFQRCode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215562027,"owners_count":15897593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode","barcode-generator","barcode-scanner","barcodes","generator","hacktoberfest","ios","macos","qrcode","qrcode-generator","qrcode-reader","qrcode-scanner","qrcodes","recognizer","swift","tvos","watchos"],"created_at":"2024-01-05T20:15:49.391Z","updated_at":"2025-08-13T07:33:46.134Z","avatar_url":"https://github.com/EFPrefix.png","language":"Swift","readme":"![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/EFQRCode.jpg)\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Carthage/Carthage/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://swift.org/package-manager/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/SPM-ready-orange.svg?style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://cocoapods.org/pods/EFQRCode\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/v/EFQRCode.svg?style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://swiftpackageindex.com/EFPrefix/EFQRCode\"\u003e\n        \u003cimg src=\"https://img.shields.io/endpoint?style=flat-square\u0026url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FEFPrefix%2FEFQRCode%2Fbadge%3Ftype%3Dplatforms\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://raw.githubusercontent.com/EFPrefix/EFQRCode/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/l/EFQRCode.svg?style=flat-square\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nEFQRCode 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.\n\n## Examples\n\n![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/QRCode5.jpg)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/QRCode6.jpg)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/QRCode7.jpg)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/QRCode8.jpg)  \n:---------------------:|:---------------------:|:---------------------:|:---------------------:\n![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample7.JPG)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample8.JPG)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample2.GIF)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample13.JPG)  \n![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample4.GIF)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample15.JPG)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample16.JPG)|![](https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/7sample1.GIF)  \n\n## Demo Projects\n\n### App Store\n\nYou can click the `App Store` button below to download demo, support iOS, tvOS and watchOS:\n\n\u003ca target='_blank' href='https://itunes.apple.com/app/EFQRCode/id1242337058?mt=8'\u003e\n    \u003cimg src='https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/icon/AppStore.jpeg' width='144' height='49'/\u003e\n\u003c/a\u003e\n\nYou can also click the `Mac App Store` button below to download demo for macOS:\n\n\u003ca target='_blank' href='https://itunes.apple.com/app/EFQRCode/id1306793539?mt=8'\u003e\n    \u003cimg src='https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/icon/AppStoreMac.png' width='168.5' height='49'/\u003e\n\u003c/a\u003e\n\n### Compile Demo Manually\n\nTo run the example project manually, clone the repo, demos are in the 'Examples' folder, then open `EFQRCode.xcworkspace` with Xcode and select the target you want, run.\n\nOr you can run the following command in terminal:\n\n```bash\ngit clone git@github.com:EFPrefix/EFQRCode.git; cd EFQRCode; open 'EFQRCode.xcworkspace'\n```\n\n## Requirements\n\niOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+ / visionOS 1.0+\n\n## Installation\n\n### CocoaPods\n\nEFQRCode is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'EFQRCode', '~\u003e 7.0.3'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate EFQRCode into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"EFPrefix/EFQRCode\" ~\u003e 7.0.3\n```\n\nRun `carthage update` to build the framework and drag the built `EFQRCode.framework` into your Xcode project.\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the Swift compiler.\n\nOnce you have your Swift package set up, adding EFQRCode as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/EFPrefix/EFQRCode.git\", .upToNextMinor(from: \"7.0.3\"))\n]\n```\n\n## Quick Start\n\n#### 1. Import EFQRCode\n\nImport EFQRCode module where you want to use it:\n\n```swift\nimport EFQRCode\n```\n\n#### 2. Recognition\n\nA String Array is returned as there might be several QR Codes in a single `CGImage`:\n\n```swift\nif let testImage = UIImage(named: \"test.png\")?.cgImage {\n    let codes = EFQRCode.Recognizer(image: testImage).recognize()\n    if !codes.isEmpty {\n        print(\"There are \\(codes.count) codes\")\n        for (index, code) in codes.enumerated() {\n            print(\"The content of QR Code \\(index) is \\(code).\")\n        }\n    } else {\n        print(\"There is no QR Codes in testImage.\")\n    }\n}\n```\n\n#### 3. Generation\n\n##### 3.1 Create QR Code with static image\n\n```swift\nlet generator = try? EFQRCode.Generator(\"https://github.com/EFPrefix/EFQRCode\", style: .image(\n    params: .init(image: .init(image: .static(image: UIImage(named: \"WWF\")?.cgImage!), allowTransparent: true)))\n)\nif let image = try? generator?.toImage(width: 180).cgImage {\n    print(\"Create QRCode image success \\(image)\")\n} else {\n    print(\"Create QRCode image failed!\")\n}\n```\n\nResult: \n\n\u003cimg src=\"https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/sample1.jpg\" width = \"36%\"/\u003e\n\n##### 3.2 Generation from animated images\n\nYou can create a dynamic QR code by passing in a sequence of animated images. The usage method is as follows:\n\n```swift\nlet generator = try? EFQRCode.Generator(\"https://github.com/EFPrefix/EFQRCode\", style: .image(\n    params: .init(image: .init(image: .animated(images: cgImages, imageDelays: cgImageDelays))))\n)\nif let imageData = try? generator?.toGIFData(width: 512) {\n    print(\"Create QRCode image success \\(imageData)\")\n} else {\n    print(\"Create QRCode image failed!\")\n}\n```\n\nYou can get more information from the demo, result will like this:\n\n\u003cimg src=\"https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/QRCodeGIF6.gif\" width = \"36%\"/\u003e\n\n##### 3.3 Exportable types\n\n- Static: NSImage, UIImage, PDF, PNG, JPEG\n- Animated: APNG, GIF, SVG, MOV, MP4, M4V\n\n#### 4. Next\n\nLearn more from [DeepWiki](https://deepwiki.com/EFPrefix/EFQRCode).\n\n## Recommendations\n\n1. Please select a high contrast foreground and background color combinations;\n2. To improve the definition of QRCode images, increase `size`;\n3. Oversized generation dimensions, excessive QR code content, and overly large imported media may lead to generation failures;\n4. It is recommended to test the QRCode image before put it into use;\n5. Any contributing and pull requests are warmly welcome;\n6. 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.\n\n## Contributors\n\n\u003ca href=\"https://opencollective.com/efqrcode#contributors\"\u003e\n    \u003cimg src=\"https://opencollective.com/efqrcode/contributors.svg?width=890\"/\u003e\n\u003c/a\u003e\n\n## Backers\n\n\u003ca href=\"https://opencollective.com/efqrcode#backers\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://opencollective.com/efqrcode/backers.svg?width=890\"\u003e\n\u003c/a\u003e\n\n## Sponsors\n\n- Thanks for the help from MacStadium's [Open Source Program](https://www.macstadium.com/opensource?from=EFQRCode).\n\n\u003ca href=\"https://macstadium.com/?from=EFQRCode\"\u003e\n    \u003cimg src=\"https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png\" width = \"46%\"\u003e\n\u003c/a\u003e\n\n- Thanks for the help from JetBrains's [Open Source Support Program](https://www.jetbrains.com/community/opensource/?from=EFQRCode).\n\n\u003ca href=\"https://www.jetbrains.com/?from=EFQRCode\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/EFPrefix/EFQRCode/ce8982e1858d62ac8b9fecec96f5369d8b1b62c3/logo/jetbrains.svg?sanitize=true\" width = \"20%\"\u003e\n\u003c/a\u003e\n\n## Contact\n\nTwitter: [@EyreFree777](https://x.com/eyrefree777)   \nWeibo: [@EyreFree](https://weibo.com/eyrefree777)   \nEmail: [eyrefree@eyrefree.org](mailto:eyrefree@eyrefree.org)   \n\n## License\n\n\u003ca href=\"https://github.com/EFPrefix/EFQRCode/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png\"\u003e\n\u003c/a\u003e\n\nEFQRCode is available under the MIT license. See the LICENSE file for more info.\n","funding_links":["https://github.com/sponsors/EyreFree","https://github.com/sponsors/ApolloZhu","https://opencollective.com/efqrcode","https://www.efqrcode.com/donations.jpg"],"categories":["Media","Libs","Swift","前端开发框架及项目","Hardware [🔝](#readme)","OOM-Leaks-Crash","Libraries"],"sub_categories":["Media Processing","Hardware","iOS_Swift应用开发","Scan","Swift"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEFPrefix%2FEFQRCode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEFPrefix%2FEFQRCode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEFPrefix%2FEFQRCode/lists"}