├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── default.md │ └── default_CN.md └── workflows │ ├── docs.yml │ └── pods.yml ├── .gitignore ├── .jazzy.yaml ├── .jazzy_CN.yaml ├── .swift-version ├── .swiftlint.yml ├── CHANGELOG.md ├── Cartfile ├── Cartfile.resolved ├── EFQRCode.podspec ├── EFQRCode.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── swiftpm │ │ └── Package.resolved └── xcshareddata │ └── xcschemes │ ├── EFQRCode iOS.xcscheme │ ├── EFQRCode macOS.xcscheme │ ├── EFQRCode tvOS.xcscheme │ └── EFQRCode watchOS.xcscheme ├── EFQRCode.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── swiftpm │ └── Package.resolved ├── Examples ├── Shared │ └── PointStyle.swift ├── iOS │ ├── AnimatedImage.swift │ ├── AppDelegate.swift │ ├── CGFloat+Example.swift │ ├── EFStyleParamImage+Example.swift │ ├── Generator │ │ ├── BasicGeneratorController.swift │ │ ├── BubbleGeneratorController.swift │ │ ├── D25GeneratorController.swift │ │ ├── DSJGeneratorController.swift │ │ ├── FunctionGeneratorController.swift │ │ ├── ImageFillGeneratorController.swift │ │ ├── ImageGeneratorController.swift │ │ ├── LineGeneratorController.swift │ │ ├── RandomRectangleGeneratorController.swift │ │ └── ResampleImageGeneratorController.swift │ ├── Localized.swift │ ├── MoreViewController.swift │ ├── RecognizerController.swift │ ├── Resources │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── 20.png │ │ │ │ ├── 20@2x-1.png │ │ │ │ ├── 20@2x-2.png │ │ │ │ ├── 20@2x.png │ │ │ │ ├── 20@3x.png │ │ │ │ ├── 29.png │ │ │ │ ├── 29@2x-1.png │ │ │ │ ├── 29@2x.png │ │ │ │ ├── 29@3x.png │ │ │ │ ├── 40@2x-1.png │ │ │ │ ├── 40@2x.png │ │ │ │ ├── 40@3x.png │ │ │ │ ├── 60@2x.png │ │ │ │ ├── 60@3x.png │ │ │ │ ├── 76.png │ │ │ │ ├── 76@2x.png │ │ │ │ ├── 83.5.png │ │ │ │ ├── AppIcon.jpg │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── EFQRCoder.imageset │ │ │ │ ├── 1024.png │ │ │ │ └── Contents.json │ │ │ ├── Generator.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── Generator.png │ │ │ ├── Recognizer.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── Recognizer.png │ │ │ ├── Sample │ │ │ │ ├── Contents.json │ │ │ │ ├── icon │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── EyreFree.imageset │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ └── eyrefree.png │ │ │ │ │ ├── GitHub.imageset │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ └── github.png │ │ │ │ │ ├── Pikachu.imageset │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ └── Pikachu.png │ │ │ │ │ └── Swift.imageset │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ └── Swift.png │ │ │ │ └── watermark │ │ │ │ │ ├── Beethoven.imageset │ │ │ │ │ ├── Beethoven.jpg │ │ │ │ │ └── Contents.json │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── Jobs.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Jobs.png │ │ │ │ │ ├── Miku.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Miku.jpg │ │ │ │ │ ├── WWF.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── WWF.png │ │ │ │ │ └── Wille.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── wille.jpg │ │ │ ├── launchimage.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── launchimage.jpg │ │ │ ├── more.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── WechatIMG199.png │ │ │ └── transparentHolder.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── istockphoto-875273764-170667a.jpg │ │ ├── Base.lproj │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── LaunchScreen.xib │ │ └── zh-Hans.lproj │ │ │ └── Main.strings │ ├── ShowController.swift │ ├── StorageUserDefaults.swift │ ├── StyleViewController.swift │ ├── UIImage+Example.swift │ ├── ViewController.swift │ ├── iOS Example.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── swiftpm │ │ │ │ └── Package.resolved │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── iOS Example.xcscheme │ │ │ └── watchOS Example.xcscheme │ ├── watchOS Example Extension │ │ ├── Assets.xcassets │ │ │ ├── Complication.complicationset │ │ │ │ ├── Circular.imageset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Contents.json │ │ │ │ ├── Extra Large.imageset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Graphic Bezel.imageset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Graphic Circular.imageset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Graphic Corner.imageset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Graphic Extra Large.imageset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Graphic Large Rectangular.imageset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Modular.imageset │ │ │ │ │ └── Contents.json │ │ │ │ └── Utilitarian.imageset │ │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ └── Sample │ │ │ │ ├── Contents.json │ │ │ │ ├── icon │ │ │ │ ├── Contents.json │ │ │ │ ├── EyreFree.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── eyrefree.png │ │ │ │ ├── GitHub.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── github.png │ │ │ │ ├── Pikachu.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Pikachu.png │ │ │ │ └── Swift.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Swift.png │ │ │ │ └── watermark │ │ │ │ ├── Beethoven.imageset │ │ │ │ ├── Beethoven.jpg │ │ │ │ └── Contents.json │ │ │ │ ├── Contents.json │ │ │ │ ├── Jobs.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── Jobs.png │ │ │ │ ├── Miku.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── Miku.jpg │ │ │ │ ├── WWF.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── WWF.png │ │ │ │ └── Wille.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── wille.jpg │ │ ├── ExtensionDelegate.swift │ │ ├── Info.plist │ │ ├── InterfaceController.swift │ │ ├── NumberPadInterfaceController.swift │ │ ├── ParametersInterfaceController.swift │ │ ├── Tests.swift │ │ ├── UnitTestInterfaceController.swift │ │ ├── UnitTestcaseRowType.swift │ │ └── VersionDisplayInterfaceController.swift │ └── watchOS Example │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── 24@2x.jpg │ │ │ ├── 27.5@2x.jpg │ │ │ ├── 29@2x.jpg │ │ │ ├── 29@3x.jpg │ │ │ ├── 40@2x.jpg │ │ │ ├── 86@2x.jpg │ │ │ ├── 98@2x.jpg │ │ │ ├── AppIcon.jpg │ │ │ ├── AppIcon100.png │ │ │ ├── AppIcon216.png │ │ │ ├── AppIcon88.png │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Base.lproj │ │ └── Interface.storyboard │ │ ├── Info.plist │ │ └── zh-Hans.lproj │ │ └── Interface.strings ├── macOS │ ├── macOS Example.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── swiftpm │ │ │ │ └── Package.resolved │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── macOS Example.xcscheme │ └── macOS Example │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── 128.png │ │ │ ├── 128@2x.png │ │ │ ├── 16.png │ │ │ ├── 16@2x.png │ │ │ ├── 256.png │ │ │ ├── 256@2x.png │ │ │ ├── 32.png │ │ │ ├── 32@2x.png │ │ │ ├── 512.png │ │ │ ├── 512@2x.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Generator.imageset │ │ │ ├── Contents.json │ │ │ └── Generator.png │ │ ├── Generator_D.imageset │ │ │ ├── Contents.json │ │ │ └── Generator_D.png │ │ ├── Recognizer.imageset │ │ │ ├── Contents.json │ │ │ └── Recognizer.png │ │ ├── Recognizer_D.imageset │ │ │ ├── Contents.json │ │ │ └── Recognizer_D.png │ │ ├── drag.imageset │ │ │ ├── Contents.json │ │ │ └── drag.png │ │ └── launchimage.imageset │ │ │ ├── Contents.json │ │ │ └── launchimage.jpg │ │ ├── Base.lproj │ │ └── Main.storyboard │ │ ├── DragDropImageView.swift │ │ ├── EFDetailButton.swift │ │ ├── EFQRCode.macOS.entitlements │ │ ├── Info.plist │ │ ├── NSColor+Example.swift │ │ ├── NSImage+Example.swift │ │ ├── ViewController+Generator.swift │ │ ├── ViewController+Recognizer.swift │ │ ├── ViewController.swift │ │ └── zh-Hans.lproj │ │ └── Main.strings └── tvOS │ ├── tvOS Example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── swiftpm │ │ │ └── Package.resolved │ └── xcshareddata │ │ └── xcschemes │ │ └── tvOS Example.xcscheme │ └── tvOS Example │ ├── Assets.xcassets │ ├── App Icon & Top Shelf Image.brandassets │ │ ├── App Icon - Large.imagestack │ │ │ ├── Back.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── EFQRCode 1.png │ │ │ │ │ └── EFQRCode.png │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── Front.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── EFQRCode 1.png │ │ │ │ │ └── EFQRCode.png │ │ │ │ └── Contents.json │ │ │ └── Middle.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ ├── App Icon - Small.imagestack │ │ │ ├── Back.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── EFQRCode 1.png │ │ │ │ │ └── EFQRCode.png │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── Front.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── EFQRCode 1.png │ │ │ │ │ └── EFQRCode.png │ │ │ │ └── Contents.json │ │ │ └── Middle.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Top Shelf Image Wide.imageset │ │ │ ├── Contents.json │ │ │ └── EFQRCode.png │ │ └── Top Shelf Image.imageset │ │ │ ├── Contents.json │ │ │ └── EFQRCode.png │ ├── Contents.json │ ├── Generator.imageset │ │ ├── Contents.json │ │ └── Generator.png │ ├── LaunchImage.launchimage │ │ ├── Contents.json │ │ └── EFQRCode.png │ ├── Recognizer.imageset │ │ ├── Contents.json │ │ └── Recognizer.png │ └── Sample │ │ ├── Contents.json │ │ ├── icon │ │ ├── Contents.json │ │ ├── EyreFree.imageset │ │ │ ├── Contents.json │ │ │ └── eyrefree.png │ │ ├── GitHub.imageset │ │ │ ├── Contents.json │ │ │ └── github.png │ │ ├── Pikachu.imageset │ │ │ ├── Contents.json │ │ │ └── Pikachu.png │ │ └── Swift.imageset │ │ │ ├── Contents.json │ │ │ └── Swift.png │ │ └── watermark │ │ ├── Beethoven.imageset │ │ ├── Beethoven.jpg │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Jobs.imageset │ │ ├── Contents.json │ │ └── Jobs.png │ │ ├── Miku.imageset │ │ ├── Contents.json │ │ └── Miku.jpg │ │ ├── WWF.imageset │ │ ├── Contents.json │ │ └── WWF.png │ │ └── Wille.imageset │ │ ├── Contents.json │ │ └── wille.jpg │ ├── Base.lproj │ └── Main.storyboard │ ├── GeneratorController.swift │ ├── Info.plist │ └── zh-Hans.lproj │ └── Main.strings ├── LICENSE ├── Package.resolved ├── Package.swift ├── Package@swift-5.3.swift ├── README.md ├── README_CN.md ├── Source ├── EFQRCode+Generator.swift ├── EFQRCode+Recognizer.swift ├── EFQRCode.h ├── EFQRCode.swift ├── Extension │ ├── BinaryFloatingPoint+EFQRCode.swift │ ├── BinaryInteger+EFQRCode.swift │ ├── CGColor+EFQRCode.swift │ ├── CGImage+EFQRCode.swift │ ├── CIImage+EFQRCode.swift │ ├── NSImage+EFQRCode.swift │ ├── String+EFQRCode.swift │ └── UIImage+EFQRCode.swift ├── Info-tvOS.plist ├── Info.plist ├── PrivacyInfo.xcprivacy ├── Styles │ ├── EFQRCodeStyle.swift │ ├── EFQRCodeStyle25D.swift │ ├── EFQRCodeStyleBasic.swift │ ├── EFQRCodeStyleBubble.swift │ ├── EFQRCodeStyleDSJ.swift │ ├── EFQRCodeStyleFunction.swift │ ├── EFQRCodeStyleImage.swift │ ├── EFQRCodeStyleImageFill.swift │ ├── EFQRCodeStyleLine.swift │ ├── EFQRCodeStyleRandomRectangle.swift │ └── EFQRCodeStyleResampleImage.swift ├── Type │ ├── EFAnimatedImageFormat.swift │ ├── EFCorrectionLevel.swift │ ├── EFEdgeInsets.swift │ ├── EFImageMode.swift │ ├── EFQRCodeError.swift │ └── EFVideoFormat.swift └── Utils │ └── Utils.swift ├── Startup.sh ├── Tests ├── Info.plist ├── Resources │ └── eyrefree.png └── Tests.swift ├── codecov.yml └── docs.sh /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at eyrefree@eyrefree.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [EyreFree, ApolloZhu] 4 | # patreon: EyreFree 5 | open_collective: efqrcode 6 | # ko_fi: eyrefree 7 | # tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | custom: https://www.efqrcode.com/donations.jpg 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: “RTFM” - Read the Fancy Manual 4 | url: https://efprefix.github.io/EFQRCode/ 5 | about: Maybe the documentation can help? 6 | - name: 加入 QQ 群 7 | url: http://shang.qq.com/wpa/qunwpa?idkey=d0f732585dcb0c6f2eb26bc9e0327f6305d18260eeba89ed26a201b520c572c0 8 | about: 但报 bug 应该还是 issue 回复快一些? 9 | - name: Chat on Gitter 10 | url: https://gitter.im/EFQRCode/Lobby 11 | about: Not sure if anyone uses this? 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Have a Question? 3 | about: Please file an issue with this template. 4 | title: '' 5 | 6 | --- 7 | 8 | ### Check List 9 | 10 | 11 | - [ ] I have read the [README.md](https://github.com/EFPrefix/EFQRCode/blob/main/README.md), but the information I need is not there. 12 | - [ ] I have searched in [existing issues](https://github.com/EFPrefix/EFQRCode/issues?utf8=%E2%9C%93&q=is%3Aissue), but did not find a similar one. 13 | 14 | ### Issue Description 15 | 16 | #### Description 17 | 18 | 19 | 20 | 21 | #### Reproduce 22 | 23 | 24 | 25 | 26 | #### Other Comment 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/default_CN.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 遇到了问题? 3 | about: 填写详细信息以便我们帮助您解决问题。 4 | title: '' 5 | 6 | --- 7 | 8 | ### 检查清单 9 | 10 | 11 | - [ ] 我已阅读 [README.md](https://github.com/EFPrefix/EFQRCode/blob/main/README_CN.md),但没找到我需要的信息。 12 | - [ ] 我已查看 [已知的问题](https://github.com/EFPrefix/EFQRCode/issues?utf8=%E2%9C%93&q=is%3Aissue),但没有相似的提问/请求。 13 | 14 | ### 问题描述 15 | 16 | #### 展开讲讲 17 | 18 | 19 | 20 | 21 | #### 重现步骤 22 | 23 | 24 | 25 | 26 | #### 其他信息 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Documentation 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - docs 8 | 9 | jobs: 10 | jazzy: 11 | runs-on: macos-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Install Jazzy 15 | run: sudo gem install jazzy 16 | - name: Generate Documentation 17 | run: ./docs.sh 18 | - name: Publish 19 | uses: peaceiris/actions-gh-pages@v3 20 | with: 21 | github_token: ${{ secrets.GITHUB_TOKEN }} 22 | publish_dir: ./docs 23 | -------------------------------------------------------------------------------- /.github/workflows/pods.yml: -------------------------------------------------------------------------------- 1 | name: CocoaPods 2 | 3 | on: 4 | release: 5 | types: [ published ] 6 | 7 | jobs: 8 | release: 9 | runs-on: macos-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Lint and Publish to CocoaPods Trunk 13 | run: pod trunk push 14 | env: 15 | COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Playgrounds 26 | timeline.xctimeline 27 | playground.xcworkspace 28 | 29 | # Swift Package Manager 30 | .build/ 31 | .swiftpm/ 32 | 33 | # Carthage 34 | Carthage/Build 35 | Carthage/ 36 | 37 | # Pods 38 | Examples/Pods 39 | Pods/ 40 | Pods 41 | Examples/Dependency.xcworkspace 42 | Examples/Dependency.xcworkspace/ 43 | Dependency.xcworkspace 44 | Dependency.xcworkspace/ 45 | 46 | docs/ 47 | -------------------------------------------------------------------------------- /.jazzy.yaml: -------------------------------------------------------------------------------- 1 | # EFQRCode Jazzy config 2 | module: EFQRCode 3 | author: EyreFree 4 | theme: fullwidth 5 | readme: README.md 6 | root_url: https://efprefix.github.io/EFQRCode 7 | github_url: https://github.com/EFPrefix/EFQRCode 8 | github_file_prefix: https://github.com/EFPrefix/EFQRCode/blob/main 9 | dash_url: https://efprefix.github.io/EFQRCode/docsets/EFQRCode.xml 10 | exclude: ./Source/EFQRCode+Migration* 11 | -------------------------------------------------------------------------------- /.jazzy_CN.yaml: -------------------------------------------------------------------------------- 1 | # EFQRCode Jazzy 设置 2 | module: EFQRCode 3 | author: EyreFree 4 | theme: fullwidth 5 | readme: README_CN.md 6 | exclude: ./* 7 | output: docs/zh 8 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 5.0 2 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | bled_rules: 2 | - type_name 3 | - variable_name 4 | - type_body_length 5 | - function_body_length 6 | - file_length 7 | excluded: 8 | - Examples 9 | - Tests 10 | type_body_length: 11 | - 5000 # warning 12 | - 10000 # error 13 | function_body_length: 14 | - 5000 # warning 15 | - 10000 # error 16 | file_length: 17 | - 5000 # warning 18 | - 10000 # error 19 | 20 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "EFPrefix/swift_qrcodejs" ~> 2.3.1 2 | github "swhitty/SwiftDraw" ~> 0.22.0 3 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "EFPrefix/swift_qrcodejs" "2.3.1" 2 | github "swhitty/SwiftDraw" "0.22.0" 3 | -------------------------------------------------------------------------------- /EFQRCode.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'EFQRCode' 3 | s.version = '7.0.2' 4 | s.summary = 'A better way to operate quick response code in Swift.' 5 | 6 | s.description = <<-DESC 7 | EFQRCode is a lightweight, pure-Swift library for generating stylized QRCode images with watermark or icon, and for recognizing QRCode from images. 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. 8 | DESC 9 | 10 | s.homepage = 'https://github.com/EFPrefix/EFQRCode' 11 | s.screenshots = 'https://raw.githubusercontent.com/EFPrefix/EFQRCode/assets/EFQRCode.jpg' 12 | s.license = { :type => 'MIT', :file => 'LICENSE' } 13 | s.authors = { 'EyreFree' => 'eyrefree@eyrefree.org', 'ApolloZhu' => 'public-apollonian@outlook.com' } 14 | s.source = { :git => 'https://github.com/EFPrefix/EFQRCode.git', :tag => s.version.to_s } 15 | s.social_media_url = 'https://twitter.com/EyreFree777' 16 | s.documentation_url = 'https://efprefix.github.io/EFQRCode' 17 | 18 | s.ios.deployment_target = '13.0' 19 | s.tvos.deployment_target = '13.0' 20 | s.osx.deployment_target = '10.15' 21 | s.watchos.deployment_target = '6.0' 22 | s.visionos.deployment_target = "1.0" 23 | 24 | s.swift_version = '5.0' 25 | s.requires_arc = true 26 | 27 | s.frameworks = 'ImageIO', 'CoreGraphics', 'Foundation' 28 | s.ios.framework = 'CoreImage' 29 | s.tvos.framework = 'CoreImage' 30 | s.osx.framework = 'CoreImage' 31 | s.visionos.framework = 'CoreImage' 32 | 33 | s.dependency 'SwiftDraw', '~> 0.22.0' 34 | s.dependency 'ef_swift_qrcodejs', '~> 2.3.1' 35 | 36 | s.source_files = 'Source/**/*.{h,swift}' 37 | end 38 | 39 | -------------------------------------------------------------------------------- /EFQRCode.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /EFQRCode.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EFQRCode.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "swift_qrcodejs", 6 | "repositoryURL": "https://github.com/ApolloZhu/swift_qrcodejs", 7 | "state": { 8 | "branch": null, 9 | "revision": "374dc7f7b9e76c6aeb393f6a84590c6d387e1ecb", 10 | "version": "2.2.2" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /EFQRCode.xcodeproj/xcshareddata/xcschemes/EFQRCode watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /EFQRCode.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /EFQRCode.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EFQRCode.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "originHash" : "be929adcdb011855acf3e6ecc7d60247342f4745a8d30decbb11d695d5801643", 3 | "pins" : [ 4 | { 5 | "identity" : "effoundation", 6 | "kind" : "remoteSourceControl", 7 | "location" : "https://github.com/EFPrefix/EFFoundation.git", 8 | "state" : { 9 | "revision" : "afb22ded5e2dfd8b375b9e4236ea9c20ecd5815f", 10 | "version" : "1.7.1" 11 | } 12 | }, 13 | { 14 | "identity" : "snapkit", 15 | "kind" : "remoteSourceControl", 16 | "location" : "https://github.com/SnapKit/SnapKit.git", 17 | "state" : { 18 | "revision" : "f222cbdf325885926566172f6f5f06af95473158", 19 | "version" : "5.6.0" 20 | } 21 | }, 22 | { 23 | "identity" : "swift_qrcodejs", 24 | "kind" : "remoteSourceControl", 25 | "location" : "https://github.com/EFPrefix/swift_qrcodejs.git", 26 | "state" : { 27 | "revision" : "d1605333f7edac39b4518538ef4f2638fdd2e4d6", 28 | "version" : "2.3.1" 29 | } 30 | }, 31 | { 32 | "identity" : "swiftdraw", 33 | "kind" : "remoteSourceControl", 34 | "location" : "https://github.com/swhitty/SwiftDraw.git", 35 | "state" : { 36 | "revision" : "a19594794cdcdee5135caad3bc119096c50c92c2", 37 | "version" : "0.22.0" 38 | } 39 | } 40 | ], 41 | "version" : 3 42 | } 43 | -------------------------------------------------------------------------------- /Examples/Shared/PointStyle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointStyle.swift 3 | // EFQRCode 4 | // 5 | // Created by Apollo Zhu on 2021/11/20. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import EFQRCode 28 | import CoreGraphics 29 | 30 | /*class StarPointStyle: EFPointStyle { 31 | func fillRect(context: CGContext, rect: CGRect, isStatic: Bool) { 32 | let path = CGMutablePath() 33 | var points: [CGPoint] = [] 34 | let radius = Float(rect.width / 2) 35 | let angel = Double.pi * 2 / 5 36 | for i in 1...5 { 37 | let x = Float(rect.width / 2) - sinf(Float(i) * Float(angel)) * radius + Float(rect.origin.x) 38 | let y = Float(rect.height / 2) - cosf(Float(i) * Float(angel)) * radius + Float(rect.origin.y) 39 | points.append(CGPoint(x: CGFloat(x), y: CGFloat(y))) 40 | } 41 | path.move(to: points.first!) 42 | for i in 1...5 { 43 | let index = (2 * i) % 5 44 | path.addLine(to: points[index]) 45 | } 46 | context.addPath(path) 47 | context.fillPath() 48 | } 49 | }*/ 50 | 51 | enum PointStyle: Int, CaseIterable { 52 | case square 53 | case circle 54 | case diamond 55 | case star 56 | 57 | /*var efPointStyle: EFPointStyle { 58 | switch self { 59 | case .square: return EFSquarePointStyle.square 60 | case .circle: return EFCirclePointStyle.circle 61 | case .diamond: return EFDiamondPointStyle.diamond 62 | case .star: return StarPointStyle() 63 | } 64 | }*/ 65 | } 66 | -------------------------------------------------------------------------------- /Examples/iOS/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/1/24. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import UIKit 28 | 29 | @UIApplicationMain 30 | class AppDelegate: UIResponder, UIApplicationDelegate { 31 | 32 | var window: UIWindow? 33 | 34 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 35 | 36 | return true 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Examples/iOS/CGFloat+Example.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGFloat+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/10/29. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import UIKit 28 | 29 | extension CGFloat { 30 | 31 | static let zeroHeight: CGFloat = leastNonzeroMagnitude 32 | 33 | // ~= 20 34 | static func statusBar() -> CGFloat { 35 | #if os(iOS) 36 | // debugPrint("statusBar: \(UIApplication.shared.statusBarFrame.height)") 37 | return UIApplication.shared.statusBarFrame.height 38 | #else 39 | return 0 40 | #endif 41 | } 42 | 43 | // ~= 44 44 | static func navigationBar(_ controller: UIViewController?) -> CGFloat { 45 | if let navi = controller?.navigationController { 46 | // debugPrint("navigationBar: \(navi.navigationBar.frame.height)") 47 | return navi.navigationBar.frame.height 48 | } 49 | // debugPrint("navigationBar: 0") 50 | return 0 51 | } 52 | 53 | // ~= 49 54 | static func tabBar(_ controller: UIViewController?) -> CGFloat { 55 | if let tabBar = controller?.tabBarController { 56 | // debugPrint("tabBar: \(tabBar.tabBar.frame.height)") 57 | return tabBar.tabBar.frame.height 58 | } 59 | // debugPrint("tabBar: 0") 60 | return 0 61 | } 62 | 63 | static func bottomSafeArea() -> CGFloat { 64 | if #available(iOS 11.0, tvOS 11.0, *) { 65 | var window: UIWindow? = UIApplication.shared.keyWindow 66 | if #available(iOS 13.0, tvOS 13.0, *) { 67 | window = UIApplication.shared.windows.first 68 | } 69 | if let window = window { 70 | return window.safeAreaInsets.bottom 71 | } 72 | } 73 | // debugPrint("tabBar: 0") 74 | return 0 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Examples/iOS/EFStyleParamImage+Example.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFStyleParamImage+Example.swift 3 | // iOS Example 4 | // 5 | // Created by EyreFree on 2024/9/21. 6 | // Copyright © 2024 EyreFree. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import EFQRCode 11 | import CoreGraphics 12 | 13 | extension EFStyleParamImage { 14 | 15 | var firstImage: CGImage { 16 | switch self { 17 | case .static(let image): 18 | return image 19 | case .animated(let images, _): 20 | return images[0] 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@2x-1.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@2x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@2x-2.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@2x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/20@3x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29@2x-1.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29@2x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/29@3x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/40@2x-1.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/40@2x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/40@3x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/60@2x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/60@3x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/76@2x.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/83.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/83.5.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon.jpg -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "20.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "20@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "29.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "29@2x-1.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "20@2x-2.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "40@2x-1.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "76.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "83.5.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "1024x1024", 107 | "idiom" : "ios-marketing", 108 | "filename" : "AppIcon.jpg", 109 | "scale" : "1x" 110 | } 111 | ], 112 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | } 116 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/EFQRCoder.imageset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/EFQRCoder.imageset/1024.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/EFQRCoder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "1024.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Generator.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Generator.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Generator.imageset/Generator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Generator.imageset/Generator.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Recognizer.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Recognizer.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Recognizer.imageset/Recognizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Recognizer.imageset/Recognizer.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/EyreFree.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "eyrefree.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/EyreFree.imageset/eyrefree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/icon/EyreFree.imageset/eyrefree.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/GitHub.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "github.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/GitHub.imageset/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/icon/GitHub.imageset/github.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/Pikachu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Pikachu.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/Pikachu.imageset/Pikachu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/icon/Pikachu.imageset/Pikachu.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/Swift.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Swift.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/icon/Swift.imageset/Swift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/icon/Swift.imageset/Swift.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Beethoven.imageset/Beethoven.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Beethoven.imageset/Beethoven.jpg -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Beethoven.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Beethoven.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Jobs.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Jobs.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Jobs.imageset/Jobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Jobs.imageset/Jobs.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Miku.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Miku.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Miku.imageset/Miku.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Miku.imageset/Miku.jpg -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/WWF.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "WWF.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/WWF.imageset/WWF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/watermark/WWF.imageset/WWF.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Wille.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "wille.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Wille.imageset/wille.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/Sample/watermark/Wille.imageset/wille.jpg -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/launchimage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "launchimage.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/launchimage.imageset/launchimage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/launchimage.imageset/launchimage.jpg -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/more.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "WechatIMG199.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/more.imageset/WechatIMG199.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/more.imageset/WechatIMG199.png -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/transparentHolder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "istockphoto-875273764-170667a.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Assets.xcassets/transparentHolder.imageset/istockphoto-875273764-170667a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/Resources/Assets.xcassets/transparentHolder.imageset/istockphoto-875273764-170667a.jpg -------------------------------------------------------------------------------- /Examples/iOS/Resources/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | EFQRCode 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | EFQRCode 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | ITSAppUsesNonExemptEncryption 26 | 27 | LSRequiresIPhoneOS 28 | 29 | NSAppleMusicUsageDescription 30 | EFQRCode needs to access your album so that you can normally use the functions of barcode or QR code recognition and generation, icon and watermark selection, etc 31 | NSPhotoLibraryUsageDescription 32 | EFQRCode needs to access your album so that you can normally use the functions of barcode or QR code recognition and generation, icon and watermark selection, etc 33 | UILaunchStoryboardName 34 | LaunchScreen 35 | UIMainStoryboardFile 36 | Main 37 | UIRequiredDeviceCapabilities 38 | 39 | armv7 40 | 41 | UIRequiresFullScreen 42 | 43 | UIStatusBarStyle 44 | UIStatusBarStyleLightContent 45 | UIStatusBarTintParameters 46 | 47 | UINavigationBar 48 | 49 | Style 50 | UIBarStyleDefault 51 | Translucent 52 | 53 | 54 | 55 | UISupportedInterfaceOrientations 56 | 57 | UIInterfaceOrientationPortrait 58 | UIInterfaceOrientationLandscapeLeft 59 | UIInterfaceOrientationLandscapeRight 60 | UIInterfaceOrientationPortraitUpsideDown 61 | 62 | UISupportedInterfaceOrientations~ipad 63 | 64 | UIInterfaceOrientationPortrait 65 | UIInterfaceOrientationPortraitUpsideDown 66 | UIInterfaceOrientationLandscapeLeft 67 | UIInterfaceOrientationLandscapeRight 68 | 69 | UIViewControllerBasedStatusBarAppearance 70 | 71 | UIUserInterfaceStyle 72 | Light 73 | 74 | 75 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Examples/iOS/Resources/zh-Hans.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Examples/iOS/StorageUserDefaults.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StorageUserDefaults.swift 3 | // iOS Example 4 | // 5 | // Created by EyreFree on 2019/2/10. 6 | // Copyright (c) 2017-2021 EyreFree 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import Foundation 27 | 28 | /// UserDefaults 持久化存储 29 | class StorageUserDefaults { 30 | 31 | let key: String 32 | var value: T? { 33 | didSet { 34 | if let tryNewValue = value { 35 | UserDefaults.standard.set(NSKeyedArchiver.archivedData(withRootObject: tryNewValue), forKey: key) 36 | } else { 37 | UserDefaults.standard.removeObject(forKey: key) 38 | } 39 | } 40 | } 41 | 42 | init(key: String) { 43 | self.key = key 44 | self.value = UserDefaults.standard.data(forKey: key).flatMap { 45 | return NSKeyedUnarchiver.unarchiveObject(with: $0) as? T 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Examples/iOS/UIImage+Example.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/4/6. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import UIKit 28 | 29 | extension UIImage { 30 | 31 | // Get avarage color 32 | func avarageColor() -> UIColor? { 33 | let rgba = UnsafeMutablePointer.allocate(capacity: 4) 34 | guard let context = CGContext( 35 | data: rgba, 36 | width: 1, 37 | height: 1, 38 | bitsPerComponent: 8, 39 | bytesPerRow: 4, 40 | space: CGColorSpaceCreateDeviceRGB(), 41 | bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue 42 | ) else { 43 | return nil 44 | } 45 | if let cgImage = self.cgImage { 46 | context.draw(cgImage, in: CGRect(x: 0, y: 0, width: 1, height: 1)) 47 | 48 | return UIColor( 49 | red: CGFloat(rgba[0]) / 255.0, 50 | green: CGFloat(rgba[1]) / 255.0, 51 | blue: CGFloat(rgba[2]) / 255.0, 52 | alpha: CGFloat(rgba[3]) / 255.0 53 | ) 54 | } 55 | return nil 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Examples/iOS/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/iOS/iOS Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/iOS/iOS Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "swift_qrcodejs", 6 | "repositoryURL": "https://github.com/ApolloZhu/swift_qrcodejs", 7 | "state": { 8 | "branch": null, 9 | "revision": "374dc7f7b9e76c6aeb393f6a84590c6d387e1ecb", 10 | "version": "2.2.2" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /Examples/iOS/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 67 | 68 | 69 | 70 | 76 | 78 | 84 | 85 | 86 | 87 | 89 | 90 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "filename" : "Circular.imageset", 5 | "idiom" : "watch", 6 | "role" : "circular" 7 | }, 8 | { 9 | "filename" : "Extra Large.imageset", 10 | "idiom" : "watch", 11 | "role" : "extra-large" 12 | }, 13 | { 14 | "filename" : "Graphic Bezel.imageset", 15 | "idiom" : "watch", 16 | "role" : "graphic-bezel" 17 | }, 18 | { 19 | "filename" : "Graphic Circular.imageset", 20 | "idiom" : "watch", 21 | "role" : "graphic-circular" 22 | }, 23 | { 24 | "filename" : "Graphic Corner.imageset", 25 | "idiom" : "watch", 26 | "role" : "graphic-corner" 27 | }, 28 | { 29 | "filename" : "Graphic Extra Large.imageset", 30 | "idiom" : "watch", 31 | "role" : "graphic-extra-large" 32 | }, 33 | { 34 | "filename" : "Graphic Large Rectangular.imageset", 35 | "idiom" : "watch", 36 | "role" : "graphic-large-rectangular" 37 | }, 38 | { 39 | "filename" : "Modular.imageset", 40 | "idiom" : "watch", 41 | "role" : "modular" 42 | }, 43 | { 44 | "filename" : "Utilitarian.imageset", 45 | "idiom" : "watch", 46 | "role" : "utilitarian" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/EyreFree.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "eyrefree.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/EyreFree.imageset/eyrefree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/EyreFree.imageset/eyrefree.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/GitHub.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "github.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/GitHub.imageset/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/GitHub.imageset/github.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/Pikachu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Pikachu.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/Pikachu.imageset/Pikachu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/Pikachu.imageset/Pikachu.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/Swift.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Swift.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/Swift.imageset/Swift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/icon/Swift.imageset/Swift.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Beethoven.imageset/Beethoven.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Beethoven.imageset/Beethoven.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Beethoven.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Beethoven.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Jobs.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Jobs.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Jobs.imageset/Jobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Jobs.imageset/Jobs.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Miku.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Miku.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Miku.imageset/Miku.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Miku.imageset/Miku.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/WWF.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "WWF.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/WWF.imageset/WWF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/WWF.imageset/WWF.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Wille.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "wille.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Wille.imageset/wille.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example Extension/Assets.xcassets/Sample/watermark/Wille.imageset/wille.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/ExtensionDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionDelegate.swift 3 | // watchOS Example Extension 4 | // 5 | // Created by Apollo Zhu on 12/27/17. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import WatchKit 28 | 29 | class ExtensionDelegate: NSObject, WKExtensionDelegate { 30 | 31 | func applicationDidFinishLaunching() { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | EFQRCode 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSExtension 24 | 25 | NSExtensionAttributes 26 | 27 | WKAppBundleIdentifier 28 | AppStore.EFQRCode.watchkitapp 29 | 30 | NSExtensionPointIdentifier 31 | com.apple.watchkit 32 | 33 | WKExtensionDelegateClassName 34 | $(PRODUCT_MODULE_NAME).ExtensionDelegate 35 | WKRunsIndependentlyOfCompanionApp 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/InterfaceController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.swift 3 | // watchOS Example Extension 4 | // 5 | // Created by Apollo Zhu on 12/27/17. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import WatchKit 28 | import EFQRCode 29 | import SwiftDraw 30 | 31 | class InterfaceController: WKInterfaceController { 32 | @IBOutlet var qrcodeImage: WKInterfaceImage! 33 | override func awake(withContext context: Any?) { 34 | super.awake(withContext: context) 35 | guard let image = context as? UIImage else { 36 | return dismiss() 37 | } 38 | qrcodeImage.setImage(image) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/NumberPadInterfaceController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NumberPadInterfaceController.swift 3 | // watchOS Example Extension 4 | // 5 | // Created by Apollo Zhu on 12/27/17. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import WatchKit 28 | 29 | typealias NumberInputHandler = (Int) -> Void 30 | 31 | extension WKInterfaceController { 32 | func presentNumberInputController(withDefault default: Int, 33 | completion handler: @escaping NumberInputHandler) { 34 | presentController(withName: "NumberPad", context: (abs(`default`), handler)) 35 | } 36 | } 37 | 38 | class NumberPadInterfaceController: WKInterfaceController { 39 | @IBOutlet var display: WKInterfaceLabel! 40 | private var value: Int = 0 { 41 | didSet { 42 | display.setText("\(value)") 43 | } 44 | } 45 | private var completion: NumberInputHandler? 46 | override func awake(withContext context: Any?) { 47 | super.awake(withContext: context) 48 | if let (preferred, handler) = context as? (Int, NumberInputHandler) { 49 | value = preferred 50 | completion = handler 51 | } 52 | } 53 | @IBAction func didFinishInput() { 54 | completion?(value) 55 | dismiss() 56 | } 57 | 58 | @IBAction func tapped0() { 59 | if value != 0 { 60 | tapped(0) 61 | } 62 | } 63 | @IBAction func tapped1() { 64 | tapped(1) 65 | } 66 | @IBAction func tapped2() { 67 | tapped(2) 68 | } 69 | @IBAction func tapped3() { 70 | tapped(3) 71 | } 72 | @IBAction func tapped4() { 73 | tapped(4) 74 | } 75 | @IBAction func tapped5() { 76 | tapped(5) 77 | } 78 | @IBAction func tapped6() { 79 | tapped(6) 80 | } 81 | @IBAction func tapped7() { 82 | tapped(7) 83 | } 84 | @IBAction func tapped8() { 85 | tapped(8) 86 | } 87 | @IBAction func tapped9() { 88 | tapped(9) 89 | } 90 | @IBAction func removeLast() { 91 | value /= 10 92 | } 93 | private func tapped(_ number: Int) { 94 | if let newValue = Int("\(value)\(number)") { 95 | value = newValue 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/UnitTestInterfaceController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UnitTestInterfaceController.swift 3 | // watchOS Example Extension 4 | // 5 | // Created by Apollo Zhu on 12/27/17. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import WatchKit 28 | import EFQRCode 29 | 30 | class UnitTestInterfaceController: WKInterfaceController { 31 | @IBOutlet var table: WKInterfaceTable! 32 | 33 | override func awake(withContext context: Any?) { 34 | super.awake(withContext: context) 35 | let tests = Tests.allTests 36 | table.setNumberOfRows(tests.count, withRowType: "UnitTestcaseRowType") 37 | for i in tests.indices { 38 | let row = table.rowController(at: i) as! UnitTestcaseRowType 39 | row.test = tests[i] 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/UnitTestcaseRowType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UnitTestcaseRowType.swift 3 | // watchOS Example Extension 4 | // 5 | // Created by Apollo Zhu on 12/27/17. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import WatchKit 28 | 29 | extension String { 30 | static let passed = "Passed" 31 | static let testing = "Testing..." 32 | } 33 | 34 | class UnitTestcaseRowType: NSObject { 35 | @IBOutlet private var testcaseNameLabel: WKInterfaceLabel? { 36 | didSet { 37 | testcaseNameLabel?.setText(test?.name) 38 | } 39 | } 40 | @IBOutlet private var testcaseStatusLabel: WKInterfaceLabel? { 41 | didSet { 42 | testcaseStatusLabel?.setText(status) 43 | } 44 | } 45 | public var test: (name: String, testcase: Testcase)? { 46 | didSet { 47 | testcaseNameLabel?.setText(test?.name) 48 | status = .testing 49 | DispatchQueue.global(qos: .userInitiated).async { [weak self] in 50 | self?.status = self?.test?.testcase() ?? .passed 51 | } 52 | } 53 | } 54 | private var status: String = .testing { 55 | didSet { 56 | testcaseStatusLabel?.setText(status) 57 | switch status { 58 | case .testing: 59 | testcaseStatusLabel?.setTextColor(.white) 60 | case .passed: 61 | testcaseStatusLabel?.setTextColor(.green) 62 | default: 63 | testcaseStatusLabel?.setTextColor(.red) 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example Extension/VersionDisplayInterfaceController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VersionDisplayInterfaceController.swift 3 | // watchOS Example Extension 4 | // 5 | // Created by Apollo Zhu on 12/27/17. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import WatchKit 28 | 29 | class VersionDisplayInterfaceController: WKInterfaceController { 30 | @IBOutlet var label: WKInterfaceLabel! 31 | 32 | override func awake(withContext context: Any?) { 33 | super.awake(withContext: context) 34 | let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String 35 | label.setText(version) 36 | } 37 | 38 | @IBAction func showUnitTests() { 39 | pushController(withName: "Tests", context: nil) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/24@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/24@2x.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/27.5@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/27.5@2x.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/29@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/29@2x.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/29@3x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/29@3x.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/40@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/40@2x.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/86@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/86@2x.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/98@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/98@2x.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon.jpg -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon100.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon216.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/AppIcon88.png -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "24x24", 5 | "idiom" : "watch", 6 | "filename" : "24@2x.jpg", 7 | "scale" : "2x", 8 | "role" : "notificationCenter", 9 | "subtype" : "38mm" 10 | }, 11 | { 12 | "size" : "27.5x27.5", 13 | "idiom" : "watch", 14 | "filename" : "27.5@2x.jpg", 15 | "scale" : "2x", 16 | "role" : "notificationCenter", 17 | "subtype" : "42mm" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "watch", 22 | "filename" : "29@2x.jpg", 23 | "role" : "companionSettings", 24 | "scale" : "2x" 25 | }, 26 | { 27 | "size" : "29x29", 28 | "idiom" : "watch", 29 | "filename" : "29@3x.jpg", 30 | "role" : "companionSettings", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "watch", 36 | "filename" : "40@2x.jpg", 37 | "scale" : "2x", 38 | "role" : "appLauncher", 39 | "subtype" : "38mm" 40 | }, 41 | { 42 | "size" : "44x44", 43 | "idiom" : "watch", 44 | "filename" : "AppIcon88.png", 45 | "scale" : "2x", 46 | "role" : "appLauncher", 47 | "subtype" : "40mm" 48 | }, 49 | { 50 | "size" : "50x50", 51 | "idiom" : "watch", 52 | "filename" : "AppIcon100.png", 53 | "scale" : "2x", 54 | "role" : "appLauncher", 55 | "subtype" : "44mm" 56 | }, 57 | { 58 | "size" : "86x86", 59 | "idiom" : "watch", 60 | "filename" : "86@2x.jpg", 61 | "scale" : "2x", 62 | "role" : "quickLook", 63 | "subtype" : "38mm" 64 | }, 65 | { 66 | "size" : "98x98", 67 | "idiom" : "watch", 68 | "filename" : "98@2x.jpg", 69 | "scale" : "2x", 70 | "role" : "quickLook", 71 | "subtype" : "42mm" 72 | }, 73 | { 74 | "size" : "108x108", 75 | "idiom" : "watch", 76 | "filename" : "AppIcon216.png", 77 | "scale" : "2x", 78 | "role" : "quickLook", 79 | "subtype" : "44mm" 80 | }, 81 | { 82 | "size" : "1024x1024", 83 | "idiom" : "watch-marketing", 84 | "filename" : "AppIcon.jpg", 85 | "scale" : "1x" 86 | } 87 | ], 88 | "info" : { 89 | "version" : 1, 90 | "author" : "xcode" 91 | } 92 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/iOS/watchOS Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | EFQRCode 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | UISupportedInterfaceOrientations 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | 28 | WKCompanionAppBundleIdentifier 29 | AppStore.EFQRCode 30 | WKWatchKitApp 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "swift_qrcodejs", 6 | "repositoryURL": "https://github.com/ApolloZhu/swift_qrcodejs", 7 | "state": { 8 | "branch": null, 9 | "revision": "374dc7f7b9e76c6aeb393f6a84590c6d387e1ecb", 10 | "version": "2.2.2" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example.xcodeproj/xcshareddata/xcschemes/macOS Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/4/20. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Cocoa 28 | 29 | @NSApplicationMain 30 | class AppDelegate: NSObject, NSApplicationDelegate { 31 | 32 | func applicationDidFinishLaunching(_ aNotification: Notification) { 33 | 34 | } 35 | 36 | func applicationWillTerminate(_ aNotification: Notification) { 37 | 38 | } 39 | 40 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 41 | return true 42 | } 43 | 44 | @IBAction func showHelp(_ sender: Any) { 45 | if let url = URL(string: "https://github.com/EFPrefix/EFQRCode") { 46 | NSWorkspace.shared.open(url) 47 | } 48 | } 49 | } 50 | 51 | func messageBox(_ message: String) { 52 | let alert = NSAlert() 53 | alert.messageText = message 54 | alert.runModal() 55 | } 56 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/128@2x.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/16@2x.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/256@2x.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/32@2x.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/512@2x.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "16@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "32@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "128@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "256@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "512@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Generator.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Generator.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Generator.imageset/Generator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/Generator.imageset/Generator.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Generator_D.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Generator_D.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Generator_D.imageset/Generator_D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/Generator_D.imageset/Generator_D.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Recognizer.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Recognizer.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Recognizer.imageset/Recognizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/Recognizer.imageset/Recognizer.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Recognizer_D.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Recognizer_D.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/Recognizer_D.imageset/Recognizer_D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/Recognizer_D.imageset/Recognizer_D.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/drag.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "drag.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/drag.imageset/drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/drag.imageset/drag.png -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/launchimage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "launchimage.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Assets.xcassets/launchimage.imageset/launchimage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/macOS/macOS Example/Assets.xcassets/launchimage.imageset/launchimage.jpg -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/EFDetailButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFDetailButton.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/11/22. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Cocoa 28 | 29 | class EFDetailButton: NSButton { 30 | 31 | var detailView: NSView? 32 | } 33 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/EFQRCode.macOS.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-write 8 | 9 | com.apple.security.network.client 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSApplicationCategoryType 24 | public.app-category.developer-tools 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2017-2021 EyreFree. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | ITSAppUsesNonExemptEncryption 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/NSColor+Example.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/4/22. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Cocoa 28 | 29 | extension NSColor { 30 | 31 | static let theme = NSColor(calibratedRed: 97.0 / 255.0, green: 207.0 / 255.0, blue: 199.0 / 255.0, alpha: 1) 32 | 33 | convenience init(value: UInt, alpha: CGFloat = 1.0) { 34 | self.init( 35 | calibratedRed: CGFloat((value & 0xFF0000) >> 16) / 255.0, 36 | green: CGFloat((value & 0x00FF00) >> 8) / 255.0, 37 | blue: CGFloat(value & 0x0000FF) / 255.0, 38 | alpha: alpha 39 | ) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Examples/macOS/macOS Example/NSImage+Example.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSImage+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/11/17. 6 | // 7 | // Copyright (c) 2017-2021 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Cocoa 28 | 29 | // https://stackoverflow.com/questions/39925248/swift-on-macos-how-to-save-nsimage-to-disk 30 | extension NSImage { 31 | 32 | var pngData: Data? { 33 | guard let tiffRepresentation = tiffRepresentation, let bitmapImage = NSBitmapImageRep(data: tiffRepresentation) else { 34 | return nil 35 | } 36 | return bitmapImage.representation(using: .png, properties: [:]) 37 | } 38 | func pngWrite(to url: URL, options: Data.WritingOptions = .atomic) -> Bool { 39 | do { 40 | try pngData?.write(to: url, options: options) 41 | return true 42 | } catch { 43 | print(error.localizedDescription) 44 | return false 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "swift_qrcodejs", 6 | "repositoryURL": "https://github.com/ApolloZhu/swift_qrcodejs", 7 | "state": { 8 | "branch": null, 9 | "revision": "374dc7f7b9e76c6aeb393f6a84590c6d387e1ecb", 10 | "version": "2.2.2" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "EFQRCode.png", 5 | "idiom" : "tv", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "EFQRCode 1.png", 10 | "idiom" : "tv", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode 1.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "layers" : [ 3 | { 4 | "filename" : "Front.imagestacklayer" 5 | }, 6 | { 7 | "filename" : "Middle.imagestacklayer" 8 | }, 9 | { 10 | "filename" : "Back.imagestacklayer" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "EFQRCode.png", 5 | "idiom" : "tv", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "EFQRCode 1.png", 10 | "idiom" : "tv", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode 1.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "tv", 9 | "scale" : "2x" 10 | } 11 | ], 12 | "info" : { 13 | "version" : 1, 14 | "author" : "xcode" 15 | } 16 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "EFQRCode.png", 5 | "idiom" : "tv", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "EFQRCode 1.png", 10 | "idiom" : "tv", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode 1.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/EFQRCode.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "layers" : [ 3 | { 4 | "filename" : "Front.imagestacklayer" 5 | }, 6 | { 7 | "filename" : "Middle.imagestacklayer" 8 | }, 9 | { 10 | "filename" : "Back.imagestacklayer" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "EFQRCode.png", 5 | "idiom" : "tv", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "EFQRCode 1.png", 10 | "idiom" : "tv", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode 1.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/EFQRCode.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "tv", 9 | "scale" : "2x" 10 | } 11 | ], 12 | "info" : { 13 | "version" : 1, 14 | "author" : "xcode" 15 | } 16 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "size" : "1280x768", 5 | "idiom" : "tv", 6 | "filename" : "App Icon - Large.imagestack", 7 | "role" : "primary-app-icon" 8 | }, 9 | { 10 | "size" : "400x240", 11 | "idiom" : "tv", 12 | "filename" : "App Icon - Small.imagestack", 13 | "role" : "primary-app-icon" 14 | }, 15 | { 16 | "size" : "2320x720", 17 | "idiom" : "tv", 18 | "filename" : "Top Shelf Image Wide.imageset", 19 | "role" : "top-shelf-image-wide" 20 | }, 21 | { 22 | "size" : "1920x720", 23 | "idiom" : "tv", 24 | "filename" : "Top Shelf Image.imageset", 25 | "role" : "top-shelf-image" 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "filename" : "EFQRCode.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "tv", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/EFQRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/EFQRCode.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "filename" : "EFQRCode.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "tv", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/EFQRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/EFQRCode.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Generator.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Generator.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Generator.imageset/Generator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Generator.imageset/Generator.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "landscape", 5 | "idiom" : "tv", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "11.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "tv", 13 | "filename" : "EFQRCode.png", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "9.0", 16 | "scale" : "1x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/LaunchImage.launchimage/EFQRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/LaunchImage.launchimage/EFQRCode.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Recognizer.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Recognizer.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Recognizer.imageset/Recognizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Recognizer.imageset/Recognizer.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/EyreFree.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "eyrefree.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/EyreFree.imageset/eyrefree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/EyreFree.imageset/eyrefree.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/GitHub.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "github.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/GitHub.imageset/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/GitHub.imageset/github.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/Pikachu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Pikachu.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/Pikachu.imageset/Pikachu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/Pikachu.imageset/Pikachu.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/Swift.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Swift.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/Swift.imageset/Swift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/icon/Swift.imageset/Swift.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Beethoven.imageset/Beethoven.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Beethoven.imageset/Beethoven.jpg -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Beethoven.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Beethoven.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Jobs.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Jobs.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Jobs.imageset/Jobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Jobs.imageset/Jobs.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Miku.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Miku.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Miku.imageset/Miku.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Miku.imageset/Miku.jpg -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/WWF.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "WWF.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/WWF.imageset/WWF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/WWF.imageset/WWF.png -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Wille.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "wille.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Wille.imageset/wille.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Examples/tvOS/tvOS Example/Assets.xcassets/Sample/watermark/Wille.imageset/wille.jpg -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | LSRequiresIPhoneOS 22 | 23 | UIMainStoryboardFile 24 | Main 25 | UIRequiredDeviceCapabilities 26 | 27 | arm64 28 | 29 | UIUserInterfaceStyle 30 | Automatic 31 | ITSAppUsesNonExemptEncryption 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Examples/tvOS/tvOS Example/zh-Hans.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2025 EyreFree 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "swift_qrcodejs", 6 | "repositoryURL": "https://github.com/EFPrefix/swift_qrcodejs.git", 7 | "state": { 8 | "branch": null, 9 | "revision": "d1605333f7edac39b4518538ef4f2638fdd2e4d6", 10 | "version": "2.3.1" 11 | } 12 | }, 13 | { 14 | "package": "SwiftDraw", 15 | "repositoryURL": "https://github.com/swhitty/SwiftDraw.git", 16 | "state": { 17 | "branch": null, 18 | "revision": "a19594794cdcdee5135caad3bc119096c50c92c2", 19 | "version": "0.22.0" 20 | } 21 | } 22 | ] 23 | }, 24 | "version": 1 25 | } 26 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | // 3 | // Package.swift 4 | // EFQRCode 5 | // 6 | // Created by EyreFree on 2017/4/1. 7 | // 8 | // Copyright (c) 2017-2021 EyreFree 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to deal 12 | // in the Software without restriction, including without limitation the rights 13 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | // THE SOFTWARE. 27 | 28 | import PackageDescription 29 | 30 | let package = Package( 31 | name: "EFQRCode", 32 | platforms: [ 33 | .macOS(.v10_15), 34 | .iOS(.v13), 35 | .tvOS(.v13), 36 | .watchOS(.v6), 37 | .visionOS(.v1) 38 | ], 39 | products: [ 40 | .library(name: "EFQRCode", targets: ["EFQRCode"]) 41 | ], 42 | dependencies: [ 43 | .package(url: "https://github.com/EFPrefix/swift_qrcodejs.git", 44 | .upToNextMinor(from: "2.3.1")), 45 | .package(url: "https://github.com/swhitty/SwiftDraw.git", 46 | .upToNextMinor(from: "0.22.0")), 47 | ], 48 | targets: [ 49 | .target(name: "EFQRCode", 50 | dependencies: [ 51 | "QRCodeSwift", 52 | "SwiftDraw" 53 | ], 54 | path: "Source", 55 | exclude: ["Info.plist", "Info-tvOS.plist"]), 56 | ], 57 | swiftLanguageVersions: [.v5] 58 | ) 59 | -------------------------------------------------------------------------------- /Package@swift-5.3.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | // 3 | // Package.swift 4 | // EFQRCode 5 | // 6 | // Created by EyreFree on 2017/4/1. 7 | // 8 | // Copyright (c) 2017-2021 EyreFree 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to deal 12 | // in the Software without restriction, including without limitation the rights 13 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | // THE SOFTWARE. 27 | 28 | import PackageDescription 29 | 30 | let package = Package( 31 | name: "EFQRCode", 32 | platforms: [ 33 | .macOS(.v10_15), 34 | .iOS(.v13), 35 | .tvOS(.v13), 36 | .watchOS(.v6), 37 | .visionOS(.v1) 38 | ], 39 | products: [ 40 | .library(name: "EFQRCode", targets: ["EFQRCode"]) 41 | ], 42 | dependencies: [ 43 | .package(url: "https://github.com/EFPrefix/swift_qrcodejs.git", 44 | .upToNextMinor(from: "2.3.1")), 45 | .package(url: "https://github.com/swhitty/SwiftDraw.git", 46 | .upToNextMinor(from: "0.22.0")), 47 | ], 48 | targets: [ 49 | .target(name: "EFQRCode", 50 | dependencies: [ 51 | .product(name: "QRCodeSwift", package: "swift_qrcodejs"), 52 | "SwiftDraw" 53 | ], 54 | path: "Source", 55 | exclude: ["Info.plist", "Info-tvOS.plist"]), 56 | .testTarget(name: "EFQRCodeSwiftTests", 57 | dependencies: ["EFQRCode"], 58 | path: "Tests", 59 | exclude: ["Info.plist"], 60 | resources: [.process("Resources")]), 61 | .testTarget(name: "EFQRCodeObjCTests", 62 | dependencies: ["EFQRCode"], 63 | path: "Tests", 64 | exclude: ["Info.plist", "Tests.swift"], 65 | resources: [.process("Resources")]), 66 | ], 67 | swiftLanguageVersions: [.v5] 68 | ) 69 | -------------------------------------------------------------------------------- /Source/EFQRCode+Recognizer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFQRCode+Recognizer.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2023/7/11. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | #if canImport(CoreImage) 28 | import CoreImage 29 | 30 | public extension EFQRCode { 31 | 32 | /// Class for recognizing QR code contents from images. 33 | class Recognizer { 34 | /// The QR code to recognize. 35 | public var image: CGImage { 36 | didSet { 37 | contentArray = nil 38 | } 39 | } 40 | 41 | /// Recognized QR code content cache. 42 | private var contentArray: [String]? 43 | 44 | /// Initialize a QR code recognizer to recognize the specified `image`. 45 | /// - Parameter image: a QR code to recognize. 46 | public init(image: CGImage) { 47 | self.image = image 48 | } 49 | 50 | /// Recognizes and returns the contents of the current QR code `image`. 51 | /// - Returns: an array of contents recognized from `image`. 52 | /// - Note: If the returned array is empty, there's no recognizable content in the QR code `image`. 53 | public func recognize() -> [String] { 54 | if nil == contentArray { 55 | contentArray = getQRString() 56 | } 57 | return contentArray! 58 | } 59 | 60 | /// Get QRCodes from image 61 | private func getQRString() -> [String] { 62 | let result = image.ciImage().recognizeQRCode( 63 | options: [CIDetectorAccuracy: CIDetectorAccuracyHigh] 64 | ) 65 | if result.isEmpty, let grayscaleImage = try? image.grayscale() { 66 | return grayscaleImage.ciImage().recognizeQRCode( 67 | options: [CIDetectorAccuracy: CIDetectorAccuracyLow] 68 | ) 69 | } 70 | return result 71 | } 72 | } 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /Source/EFQRCode.h: -------------------------------------------------------------------------------- 1 | // 2 | // EFQRCode.h 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2017/4/16. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | @import Foundation; 28 | 29 | FOUNDATION_EXPORT double EFQRCodeVersionNumber; 30 | FOUNDATION_EXPORT const unsigned char EFQRCodeVersionString[]; 31 | -------------------------------------------------------------------------------- /Source/EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFQRCode.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2023/7/11. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | public class EFQRCode { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Source/Extension/BinaryFloatingPoint+EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BinaryFloatingPoint+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2019/11/20. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | import CoreGraphics 29 | 30 | extension BinaryFloatingPoint { 31 | 32 | var bool: Bool { 33 | return 0 != self 34 | } 35 | 36 | var cgFloat: CGFloat { 37 | return CGFloat(self) 38 | } 39 | 40 | var double: Double { 41 | return Double(self) 42 | } 43 | 44 | var float: Float { 45 | return Float(self) 46 | } 47 | 48 | var int: Int { 49 | return Int(self) 50 | } 51 | 52 | var int8: Int8 { 53 | return Int8(self) 54 | } 55 | 56 | var int16: Int16 { 57 | return Int16(self) 58 | } 59 | 60 | var int32: Int32 { 61 | return Int32(self) 62 | } 63 | 64 | var int64: Int64 { 65 | return Int64(self) 66 | } 67 | 68 | var uInt: UInt { 69 | return UInt(self) 70 | } 71 | 72 | var uInt8: UInt8 { 73 | return UInt8(self) 74 | } 75 | 76 | var uInt16: UInt16 { 77 | return UInt16(self) 78 | } 79 | 80 | var uInt32: UInt32 { 81 | return UInt32(self) 82 | } 83 | 84 | var uInt64: UInt64 { 85 | return UInt64(self) 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Source/Extension/BinaryInteger+EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BinaryInteger+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2019/11/20. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | import CoreGraphics 29 | 30 | extension BinaryInteger { 31 | 32 | var bool: Bool { 33 | return 0 != self 34 | } 35 | 36 | var cgFloat: CGFloat { 37 | return CGFloat(self) 38 | } 39 | 40 | var double: Double { 41 | return Double(self) 42 | } 43 | 44 | var float: Float { 45 | return Float(self) 46 | } 47 | 48 | var int: Int { 49 | return Int(self) 50 | } 51 | 52 | var int8: Int8 { 53 | return Int8(self) 54 | } 55 | 56 | var int16: Int16 { 57 | return Int16(self) 58 | } 59 | 60 | var int32: Int32 { 61 | return Int32(self) 62 | } 63 | 64 | var int64: Int64 { 65 | return Int64(self) 66 | } 67 | 68 | var uInt: UInt { 69 | return UInt(self) 70 | } 71 | 72 | var uInt8: UInt8 { 73 | return UInt8(self) 74 | } 75 | 76 | var uInt16: UInt16 { 77 | return UInt16(self) 78 | } 79 | 80 | var uInt32: UInt32 { 81 | return UInt32(self) 82 | } 83 | 84 | var uInt64: UInt64 { 85 | return UInt64(self) 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Source/Extension/CGColor+EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGColor++.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2023/7/2. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | import CoreGraphics 29 | 30 | extension CGColor { 31 | 32 | static func createWith(rgb: UInt32, alpha: CGFloat = 1.0) -> CGColor? { 33 | let red = CGFloat((rgb & 0xFF0000) >> 16) / 255.0 34 | let green = CGFloat((rgb & 0x00FF00) >> 8) / 255.0 35 | let blue = CGFloat(rgb & 0x0000FF) / 255.0 36 | let components = [red, green, blue, alpha] 37 | let colorSpace = CGColorSpaceCreateDeviceRGB() 38 | return CGColor(colorSpace: colorSpace, components: components) 39 | } 40 | 41 | func hexString() throws -> String { 42 | let rgbaColor = try self.rgbaColor() 43 | guard let components = rgbaColor.components, components.count >= 3 else { 44 | throw EFQRCodeError.invalidCGColorComponents 45 | } 46 | let red = components[0] 47 | let green = components[1] 48 | let blue = components[2] 49 | let hexString = String(format: "#%02lX%02lX%02lX", lroundf(Float(red * 255)), lroundf(Float(green * 255)), lroundf(Float(blue * 255))) 50 | return hexString 51 | } 52 | 53 | func alpha() throws -> CGFloat { 54 | let rgbaColor = try self.rgbaColor() 55 | guard let components = rgbaColor.components, components.count >= 3 else { 56 | throw EFQRCodeError.invalidCGColorComponents 57 | } 58 | let alpha: CGFloat = { 59 | if components.count > 3 { 60 | return components[3] 61 | } 62 | return 1 63 | }() 64 | return alpha 65 | } 66 | 67 | func rgbaColor() throws -> CGColor { 68 | let rgbColorSpace = CGColorSpaceCreateDeviceRGB() 69 | if let colorSpace = self.colorSpace, CFEqual(colorSpace, rgbColorSpace) { 70 | return self 71 | } 72 | guard let rgbColor = self.converted(to: rgbColorSpace, intent: .defaultIntent, options: nil) else { 73 | throw EFQRCodeError.colorSpaceConversionFailure 74 | } 75 | return rgbColor 76 | } 77 | 78 | func rgba() throws -> (red: UInt8, green: UInt8, blue: UInt8, alpha: CGFloat) { 79 | let rgbaColor: CGColor = try self.rgbaColor() 80 | if let components = rgbaColor.components, components.count >= 3 { 81 | return( 82 | red: UInt8(components[0] * 255.0), 83 | green: UInt8(components[1] * 255.0), 84 | blue: UInt8(components[2] * 255.0), 85 | alpha: components.count > 3 ? components[3] : 1 86 | ) 87 | } else { 88 | throw EFQRCodeError.invalidCGColorComponents 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Source/Extension/CIImage+EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CIImage+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2023/7/11. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | #if canImport(CoreImage) 28 | import CoreImage 29 | import CoreImage.CIFilterBuiltins 30 | 31 | #if canImport(UIKit) 32 | import UIKit 33 | #endif 34 | 35 | extension CIImage { 36 | func cgImage() -> CGImage? { 37 | if #available(iOS 10, macOS 10.12, tvOS 10, watchOS 2, *) { 38 | if let cgImage = self.cgImage { 39 | return cgImage 40 | } 41 | } 42 | return CIContext().createCGImage(self, from: self.extent) 43 | } 44 | 45 | #if canImport(UIKit) 46 | func uiImage() -> UIImage { 47 | return UIImage(ciImage: self) 48 | } 49 | #endif 50 | 51 | /// Get QRCode from image 52 | func recognizeQRCode(options: [String : Any]? = nil) -> [String] { 53 | var result = [String]() 54 | let detector = CIDetector(ofType: CIDetectorTypeQRCode, context: nil, options: options) 55 | guard let features = detector?.features(in: self) else { 56 | return result 57 | } 58 | result = features.compactMap { feature in 59 | (feature as? CIQRCodeFeature)?.messageString 60 | } 61 | return result 62 | } 63 | } 64 | #endif 65 | -------------------------------------------------------------------------------- /Source/Extension/NSImage+EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSImage+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2024/7/27. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | #if !canImport(UIKit) 28 | import AppKit 29 | import CoreImage 30 | 31 | extension NSImage { 32 | func ciImage() -> CIImage? { 33 | return self.tiffRepresentation(using: .none, factor: 0).flatMap(CIImage.init) 34 | } 35 | 36 | func cgImage() -> CGImage? { 37 | return self.cgImage(forProposedRect: nil, context: nil, hints: nil) ?? ciImage()?.cgImage() 38 | } 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /Source/Extension/String+EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+EFQRCode.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2024/10/12. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | extension String { 30 | 31 | func replaceSuffix(string: String, with: String) -> String { 32 | if self.hasSuffix(string) { 33 | return "\(self.dropLast(string.count))" + with 34 | } 35 | return self 36 | } 37 | 38 | func replace(_ string: String, with: String, options: String.CompareOptions = [], range: Range? = nil) -> String { 39 | return replacingOccurrences(of: string, with: with, options: options, range: range) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Source/Extension/UIImage+EFQRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2024/7/27. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import CoreGraphics 28 | import ImageIO 29 | #if canImport(UIKit) 30 | import UIKit 31 | #if canImport(CoreImage) 32 | import CoreImage 33 | #endif 34 | 35 | extension UIImage { 36 | #if canImport(CoreImage) 37 | func ciImage() -> CIImage? { 38 | return self.ciImage ?? CIImage(image: self) 39 | } 40 | #endif 41 | 42 | func cgImage() -> CGImage? { 43 | let rtnValue = self.cgImage 44 | #if canImport(CoreImage) 45 | return rtnValue ?? ciImage()?.cgImage() 46 | #else 47 | return rtnValue 48 | #endif 49 | } 50 | } 51 | #endif 52 | -------------------------------------------------------------------------------- /Source/Info-tvOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 7.0.2 19 | CFBundleSignature 20 | EFPX 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | arm64 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 7.0.2 19 | CFBundleSignature 20 | EFPX 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Source/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyTracking 6 | 7 | NSPrivacyAccessedAPITypes 8 | 9 | NSPrivacyCollectedDataTypes 10 | 11 | NSPrivacyTrackingDomains 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/Type/EFAnimatedImageFormat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFAnimatedImageFormat.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2024/9/5. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | #if canImport(MobileCoreServices) 29 | import MobileCoreServices 30 | #else 31 | import CoreServices 32 | #endif 33 | import UniformTypeIdentifiers 34 | 35 | enum EFAnimatedImageFormat: CaseIterable { 36 | case gif 37 | case apng 38 | 39 | var identifier: CFString { 40 | switch self { 41 | case .gif: 42 | if #available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) { 43 | return UTType.gif.identifier as CFString 44 | } else { 45 | return kUTTypeGIF 46 | } 47 | case .apng: 48 | if #available(iOS 14.0,macOS 11.0, tvOS 14.0, watchOS 7.0, *) { 49 | return UTType.png.identifier as CFString 50 | } else { 51 | return kUTTypePNG 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Source/Type/EFCorrectionLevel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFCorrectionLevel.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2023/7/6. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | import CoreGraphics 29 | 30 | import QRCodeSwift 31 | 32 | /// Levels of tolerance. 33 | public enum EFCorrectionLevel: CaseIterable { 34 | /// L 7%. 35 | case l 36 | /// M 15%. 37 | case m 38 | /// Q 25%. 39 | case q 40 | /// H 30%. 41 | case h 42 | } 43 | 44 | extension EFCorrectionLevel { 45 | 46 | /// Representation of `self` in QRCodeSwift. 47 | var qrErrorCorrectLevel: QRErrorCorrectLevel { 48 | switch self { 49 | case .h: return .H 50 | case .l: return .L 51 | case .m: return .M 52 | case .q: return .Q 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Source/Type/EFEdgeInsets.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFEdgeInsets.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2024/9/11. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | import SwiftDraw 29 | 30 | #if canImport(AppKit) 31 | import AppKit 32 | public typealias EFEdgeInsets = NSEdgeInsets 33 | public extension EFEdgeInsets { 34 | static let zero = NSEdgeInsetsZero 35 | } 36 | #elseif canImport(UIKit) 37 | import UIKit 38 | public typealias EFEdgeInsets = UIEdgeInsets 39 | #elseif canImport(WatchKit) 40 | import WatchKit 41 | public typealias EFEdgeInsets = UIEdgeInsets 42 | #endif 43 | -------------------------------------------------------------------------------- /Source/Type/EFQRCodeError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFQRCodeError.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2023/7/3. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | import QRCodeSwift 30 | 31 | /// All possible errors that could occur when constructing `EFQRCode`. 32 | public enum EFQRCodeError: Error { 33 | /// The thing you want to save is too large for `QRCode`. 34 | case dataLengthExceedsCapacityLimit 35 | /// Can not encode the given string using the specified encoding. 36 | case text(String, incompatibleWithEncoding: String.Encoding) 37 | 38 | /// Color space conversion failure 39 | case colorSpaceConversionFailure 40 | /// colorSpaceCreateFailure 41 | case colorSpaceCreateFailure 42 | /// Can not get components from CGColor 43 | case invalidCGColorComponents 44 | /// Can not create mutableData 45 | case cannotCreateMutableData 46 | /// Can not create CGImage destination 47 | case cannotCreateCGImageDestination 48 | /// Can not finalize CGImage destination 49 | case cannotFinalizeCGImageDestination 50 | /// Can not create CGContext 51 | case cannotCreateCGContext 52 | /// Can not create CGContext 53 | case cannotCreateSVGDocument 54 | /// Can not create CGImage 55 | case cannotCreateCGImage 56 | /// Can not create UIImage 57 | case cannotCreateUIImage 58 | /// Can not create image data 59 | case cannotCreateImageData 60 | /// Can not create GIF 61 | case cannotCreateAnimatedImage 62 | /// Can not create video 63 | case cannotCreateVideo 64 | /// Fill a new issue on GitHub, or submit a pull request. 65 | case internalError(ImplmentationError) 66 | 67 | /// Should probably contact developer is you ever see any of these. 68 | public enum ImplmentationError { 69 | /// fail to determine how large is the data. 70 | case dataLengthIndeterminable 71 | /// fail to find appropriate container for your data. 72 | case dataLength(Int, exceedsCapacityLimit: Int) 73 | } 74 | } 75 | 76 | extension QRCodeError { 77 | 78 | var efQRCodeError: EFQRCodeError { 79 | switch self { 80 | case .dataLengthExceedsCapacityLimit: 81 | return .dataLengthExceedsCapacityLimit 82 | case .text(let string, let encoding): 83 | return EFQRCodeError.text(string, incompatibleWithEncoding: encoding) 84 | case .internalError(let impError): 85 | switch impError { 86 | case .dataLengthIndeterminable: 87 | return EFQRCodeError.internalError(.dataLengthIndeterminable) 88 | case .dataLength(let value, let limit): 89 | return EFQRCodeError.internalError(.dataLength(value, exceedsCapacityLimit: limit)) 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Source/Type/EFVideoFormat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EFVideoFormat.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2024/11/2. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | #if canImport(AVFoundation) && !os(watchOS) 28 | import Foundation 29 | import AVFoundation 30 | import CoreVideo 31 | 32 | public enum EFVideoFormat { 33 | case mov 34 | case mp4 35 | case m4v 36 | 37 | var fileType: AVFileType { 38 | switch self { 39 | case .mov: return .mov 40 | case .mp4: return .mp4 41 | case .m4v: return .m4v 42 | } 43 | } 44 | 45 | public var fileExtension: String { 46 | switch self { 47 | case .mov: return "mov" 48 | case .mp4: return "mp4" 49 | case .m4v: return "m4v" 50 | } 51 | } 52 | 53 | var videoSettings: [String: Any] { 54 | var settings: [String: Any] = [ 55 | AVVideoCodecKey: AVVideoCodecType.h264, 56 | ] 57 | 58 | switch self { 59 | case .mov: 60 | break 61 | case .mp4, .m4v: 62 | settings[AVVideoCompressionPropertiesKey] = [ 63 | AVVideoAverageBitRateKey: 2000000, 64 | AVVideoMaxKeyFrameIntervalKey: 30, 65 | AVVideoAllowFrameReorderingKey: false 66 | ] 67 | } 68 | 69 | return settings 70 | } 71 | } 72 | #endif 73 | -------------------------------------------------------------------------------- /Source/Utils/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // EFQRCode 4 | // 5 | // Created by EyreFree on 2023/7/2. 6 | // 7 | // Copyright (c) 2017-2024 EyreFree 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | 27 | import Foundation 28 | 29 | class Utils { 30 | 31 | static func ShowNotImplementedError(file: String = #file, method: String = #function, line: Int = #line) { 32 | fatalError("\((file as NSString).lastPathComponent)[\(line)], \(method) has not been implemented") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Startup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 7.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/Resources/eyrefree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EFPrefix/EFQRCode/8fd070d865c6fa8ae87412af63c47e62591d89ed/Tests/Resources/eyrefree.png -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - Carthage 3 | - Tests 4 | - Examples 5 | - Package.swift -------------------------------------------------------------------------------- /docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | jazzy 3 | jazzy --config .jazzy_CN.yaml --------------------------------------------------------------------------------