ランキングに戻る

shaps80/SwiftUIBackports

Swift

A collection of SwiftUI backports for iOS, macOS, tvOS and watchOS

modalpresentationswifttextviewsharesheetbackportphotopickerpropertywrapperswiftuiiosmacostvos
スター成長
スター
1.1k
フォーク
71
週間成長
Issue
2
5001k
2022年6月2023年10月2025年3月2026年7月
README

watchOS macOS tvOS ios swift

SwiftUI Backports

Use modern SwiftUI APIs while still supporting older Apple platforms.

SwiftUIBackports mirrors Apple's SwiftUI API names, shapes, behavior, documentation, and availability where practical. This keeps app code familiar today, and easy to migrate away from once your deployment target reaches the native API.

Backports are discovered through .backport, the Backport namespace, or backport-prefixed environment values. The package also includes a machine-readable index and agent skill to help developers and coding agents find the right compatibility API quickly.

Additional APIs, when present, are kept separate from Apple API-matching backports.

This repo can also serve as a reference for building practical SwiftUI backports with minimal hacks.

[!CAUTION] From v27, SwiftUIBackports will require iOS 15+, macOS 12+, tvOS 15+, and watchOS 8+. If you need to support older platform versions, remain on 26.x.

[!NOTE] Using an agent? Install the bundled discovery skill so coding agents can find available backports automatically:

npx skills add shaps80/SwiftUIBackports

Building useful libraries like these, takes time away from my family. I build these tools in my spare time because I feel its important to give back to the community. Please consider Sponsoring me as it helps keep me working on useful libraries like these 😬

You can also give me a follow and a 'thanks' anytime.

Twitter

Usage

SwiftUIBackports mirrors Apple's SwiftUI APIs where practical, while keeping backported APIs easy to find and remove once your deployment target reaches the native API.

View modifiers are available from .backport:

sheetContent
    .backport.presentationDetents([.medium, .large])

Backported types are usually available from the Backport namespace:

Backport.LabeledContent("", value: 0)

If the compiler needs the fully-qualified namespace, use Backport<Any>:

Backport<Any>.LabeledContent("", value: 0)

Environment backports use a backport prefix:

@Environment(\.backportRequestReview) private var requestReview

Backports

The supported backports are indexed in:

skills/swiftui-backports/references/Backports.jsonl

The line-oriented index lists implemented backports, their kind, source location, and platform availability. Prefer this index over static README examples, which get stale quickly.

This repository also includes an agent skill:

skills/swiftui-backports/SKILL.md

Use that skill when working in an app that targets older Apple OS versions, or when a compiler availability error blocks use of a newer SwiftUI API. The skill tells agents to:

  • check the project deployment target
  • search the bundled backport index
  • prefer native SwiftUI when the deployment target is new enough
  • use .backport, Backport, or backport environment keys when a matching backport exists

Installation

You can install manually (by copying the files in the Sources directory) or using Swift Package Manager (preferred)

To install using Swift Package Manager, add this to the dependencies section of your Package.swift file:

.package(url: "https://github.com/shaps80/SwiftUIBackports.git", .upToNextMajor(from: "2.0.0"))

関連リポジトリ
t4t5/sweetalert

A beautiful replacement for JavaScript's "alert"

TypeScriptnpmMIT Licensemodalsweetalert
sweetalert.js.org
22.3k2.8k
sweetalert2/sweetalert2

✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. 🇺🇦🇪🇺

JavaScriptnpmMIT Licensesweetalertalert
sweetalert2.github.io
18.1k1.6k
gorhom/react-native-bottom-sheet

A performant interactive bottom sheet with fully configurable options 🚀

TypeScriptnpmMIT Licensebottom-sheetbottomsheet
gorhom.dev/react-native-bottom-sheet/
9k957
x-extends/vxe-table

vxe table 支持 vue2, vue3 的表格解决方案

TypeScriptnpmMIT Licensevxe-tablevue
vxetable.cn
8.6k1.1k
ng-bootstrap/ng-bootstrap

Angular powered Bootstrap

TypeScriptnpmMIT Licenseangularng-bootstrap
ng-bootstrap.github.io
8.2k1.6k
reactjs/react-modal

Accessible modal dialog component for React

JavaScriptnpmMIT Licensereactjavascript
reactcommunity.org/react-modal
7.4k812
fancyapps/fancybox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.

JavaScriptnpmfancyboxlightbox
fancyapps.com
7.2k1.7k
react-native-modal/react-native-modal

An enhanced, animated, customizable Modal for React Native.

TypeScriptnpmMIT Licensereact-nativereact
5.7k656
algolia/autocomplete

🔮 Fast and full-featured autocomplete library

TypeScriptnpmMIT Licenseautocompletedropdown
alg.li/autocomplete
5.3k340
jschr/bootstrap-modal

Extends the default Bootstrap Modal class. Responsive, stackable, ajax and more.

JavaScriptnpmApache License 2.0bootstrapbootstrap-modal
jschr.github.io/bootstrap-modal/
5k1.1k
willmcpo/body-scroll-lock

Body scroll locking that just works with everything 😏

JavaScriptnpmMIT Licensebody-scroll-lockreact-scroll-lock
4.1k326
Orderella/PopupDialog

A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.

SwiftOtherpopup-dialogpopup
mwfire.de
4k518