Supported Platforms for EFQRCode: iOS, macOS, tvOS, watchOS, and visionOS

EFQRCode supports iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+, and visionOS 1.0+ through a unified Swift codebase that relies on CoreGraphics, CoreImage, and ImageIO frameworks.

EFQRCode is a cross-platform Swift library maintained by EFPrefix that generates and recognizes QR codes across Apple's entire ecosystem. Understanding the supported platforms for EFQRCode is essential when setting minimum deployment targets in your Xcode projects, as the library leverages modern CoreImage APIs available only on newer OS versions.

Platform Requirements and Minimum OS Versions

EFQRCode explicitly declares support for five Apple platforms with specific minimum version constraints:

Platform Minimum Version
iOS 13.0+
macOS 10.15+
tvOS 13.0+
watchOS 6.0+
visionOS 1.0+

These requirements ensure access to the CoreImage filters and CoreGraphics bitmap contexts necessary for QR code rendering and recognition.

How Platform Support is Declared in Package Manifests

The library enforces these platform constraints through Swift Package Manager manifest files. The classic Package.swift declares the core quartet of platforms at lines 32-37:

// Package.swift (lines 32-37)
platforms: [
    .iOS(.v13),
    .macOS(.v10_15),
    .tvOS(.v13),
    .watchOS(.v6)
],

For developers using Swift 5.9 or later, the Package@swift-5.9.swift manifest extends support to include visionOS at line 37:

// Package@swift-5.9.swift (line 37)
platforms: [
    .iOS(.v13),
    .macOS(.v10_15),
    .tvOS(.v13),
    .watchOS(.v6),
    .visionOS(.v1)
]

The README.md (lines 56-59) reiterates these requirements for developer visibility.

Cross-Platform Implementation Architecture

EFQRCode achieves cross-platform compatibility by relying exclusively on CoreGraphics, CoreImage, and ImageIO frameworks available uniformly across all supported targets. The library abstracts platform-specific image types through thin wrapper extensions located in the Source/Extension directory.

iOS, tvOS, and watchOS Usage

On iOS and related platforms, EFQRCode works with UIImage and underlying CGImage references:

import EFQRCode
import UIKit

let generator = try? EFQRCode.Generator(
    content: "https://github.com/EFPrefix/EFQRCode",
    style: .image(params: .init(
        image: .init(image: .static(image: UIImage(named: "logo")?.cgImage!))
    ))
)

if let cgImage = try? generator?.toImage(width: 250).cgImage {
    let img = UIImage(cgImage: cgImage)
    // Display img in your UI
}

macOS Implementation

macOS applications use NSImage instead, requiring a different initialization pattern while maintaining identical generator APIs:

import EFQRCode
import AppKit

let generator = try? EFQRCode.Generator(
    content: "https://github.com/EFPrefix/EFQRCode",
    style: .image(params: .init(
        image: .init(image: .static(image: NSImage(named: "logo")?.cgImage!))
    ))
)

if let cgImage = try? generator?.toImage(width: 250).cgImage {
    let img = NSImage(cgImage: cgImage, size: NSSize(width: 250, height: 250))
    // Use img in your macOS UI
}

Shared QR Code Recognition

The recognition API remains identical across all platforms, operating directly on CGImage:

import EFQRCode
import CoreGraphics

if let cgImg = UIImage(named: "sampleQR")?.cgImage {  // or NSImage on macOS
    let codes = EFQRCode.Recognizer(image: cgImg).recognize()
    print("Found codes:", codes)  // Works identically on every platform
}

visionOS Conditional Compilation

For visionOS-specific considerations, use compiler directives while maintaining the same core logic:

#if os(visionOS)
import SwiftUI
#else
import UIKit
#endif

import EFQRCode
// Remaining code works identically across all platforms

Key Source Files Defining Platform Support

The following files in the EFPrefix/EFQRCode repository establish and enforce platform compatibility:

File Role Location
Package.swift Declares platform support for iOS, macOS, tvOS, and watchOS Package.swift
Package@swift-5.9.swift Adds visionOS support for Swift 5.9+ toolchains Package@swift-5.9.swift
README.md Documents platform requirements (lines 56-59) README.md
Source/EFQRCode.swift Central module with cross-platform implementation comments EFQRCode.swift
Source/Extension/ Platform-specific wrappers (UIImage+EFQRCode.swift, NSImage+EFQRCode.swift, CGImage+EFQRCode.swift) Source/Extension

Summary

EFQRCode provides comprehensive QR code generation and recognition across Apple's entire ecosystem through a unified Swift codebase:

  • iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+, and visionOS 1.0+ are all supported platforms
  • Platform requirements are explicitly declared in Package.swift (lines 32-37) and Package@swift-5.9.swift (line 37)
  • The library relies on CoreGraphics, CoreImage, and ImageIO frameworks available uniformly across all targets
  • Platform-specific image types (UIImage, NSImage) are abstracted through extensions in the Source/Extension directory
  • Integration is available via Swift Package Manager, CocoaPods, or Carthage across all supported platforms

Frequently Asked Questions

What is the minimum iOS version required for EFQRCode?

EFQRCode requires iOS 13.0 or later. This minimum version is specified in the Package.swift manifest at lines 32-37, ensuring access to modern CoreImage APIs necessary for QR code generation and recognition.

Does EFQRCode support macOS applications?

Yes, EFQRCode fully supports macOS 10.15 (Catalina) and later. macOS apps use NSImage instead of UIImage, but the underlying EFQRCode.Generator and EFQRCode.Recognizer APIs remain identical across platforms.

Can I use EFQRCode on visionOS devices?

EFQRCode supports visionOS 1.0+ when using Swift 5.9 or later. This support is declared in the Package@swift-5.9.swift manifest at line 37. The library works with standard SwiftUI visionOS apps using the same CoreGraphics-based implementation as other platforms.

Is the same EFQRCode API used across all Apple platforms?

Yes, the core API is identical across all supported platforms. EFQRCode relies on CGImage for image processing, which is available on iOS, macOS, tvOS, watchOS, and visionOS. Platform-specific extensions in Source/Extension/ (such as UIImage+EFQRCode.swift and NSImage+EFQRCode.swift) provide thin wrappers that allow you to use familiar image types while calling the same underlying generator and recognizer methods.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →