EmadBeyrami GitHub avatar

SwiftUIBackportKit

EmadBeyrami

A lightweight, dependency-free SwiftUI package that enables clean multi-version iOS support by providing modifier chaining helpers, a backport namespace, and version-gated value selection without duplicating views or scattering `#available` checks.

Stars

9

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-30

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It solves a common SwiftUI frustration—breaking modifier chains with version checks—by offering a small, well-tested API that keeps code clean and maintainable across iOS 15+.

Who it is for

  • SwiftUI developers targeting iOS 15+ with need for iOS 17+ features
  • iOS app teams maintaining backward compatibility across multiple OS versions
  • Developers tired of duplicate views or scattered `#available` conditions
  • Open-source contributors wanting to extend the package with new backports

Use cases

  • Adding iOS 17-only `contentTransition` inside a modifier chain without breaking it
  • Using the new two-value `onChange` callback on iOS 15/16 via a built-in backport
  • Applying `scrollBounceBehavior(.basedOnSize)` only on iOS 16.4+ with a no-op fallback
  • Picking different spacing or corner radius values per OS version with `platformValue`

Strengths

  • Zero external dependencies and fully unit-tested with a runnable example app
  • Keeps modifier chains intact using `.modify {}`, avoiding view duplication
  • Provides a discoverable `.backport` namespace that mirrors real SwiftUI API
  • Includes four production-ready backports (`onChange`, `scrollBounceBehavior`, `scrollClipDisabled`, `presentationDetents`) with clear fallback behavior

Considerations

  • Requires iOS 15.0+ and Swift 5.9+, excluding older deployment targets
  • `platformValue` uses runtime checks and cannot be used for version-gated types or methods
  • Only four built-in backports; users must write custom extensions for other APIs

README quick start

Quick start

Description

Backport modern SwiftUI APIs while supporting older iOS versions.

Related repositories

Similar projects matched by category, topics, and programming language.

uzairansaruzi
Featured
uzairansaruzi GitHub avatar

hermex

Hermex is a native SwiftUI iPhone app that lets you control a self-hosted Hermes AI agent directly from your phone, with no subscriptions, tracking, or third-party relay.

AI & Machine LearningLarge Language Models
941
mana-am
mana-am GitHub avatar

matrix-swift

A SwiftUI library with over 100 deterministic, pattern-driven dot-matrix loading indicators ported from a popular React collection.

Swift
150
makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958