Skip to content

A collection of Swift backports for earlier versions of iOS, macOS, tvOS and watchOS

License

Notifications You must be signed in to change notification settings

shaps80/SwiftBackports

Repository files navigation

watchOS macOS tvOS ios swift

Swift Backports

Introducing a collection of SwiftUI backports to make your iOS development easier.

Backports attempts to bring features back to the earliest possible versions of iOS to enable greater support for modern API.

Note, all backports will be API-matching to Apple's official APIs, any additional features will not be provided.

All backports are fully documented, in most cases using Apple's own documentation for consistency. Please refer to the header docs or Apple's original documentation for more details.

Lastly, I hope this repo also serves as a great resource for how you can backport effectively with minimal hacks 👍

Sponsor

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

The library adopts a backport design by Dave DeLong that makes use of a single type to improve discoverability and maintainability when the time comes to remove your backport implementations, in favour of official APIs.

Backports for types are discoverable under the Backport.Foo namespace. Similarly backported functions are discoverable via backport.foo.

In some cases an entire framework has been backported.

Backports

  • UniformTypeIdentifiers
  • CoreTransferable
  • URLSession async methods

Where applicable, backports to associated APIs on other types (e.g. URL) will also be included as expected.

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/SwiftBackports.git", .upToNextMinor(from: "1.0.0"))

About

A collection of Swift backports for earlier versions of iOS, macOS, tvOS and watchOS

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages