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

What's New




  • ImageRenderer
  • ShareLink (basic version)


  • Custom LabeledContentStyle's now respect hidden labels correctly

watchOS macOS tvOS ios swift

SwiftUI Backports

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

Many backports support iOS 13+ but where UIKIt features were introduced in later versions, the same will be applicable to these backports, to keep parity with UIKit.

In some cases, I've also included additional APIs that bring more features to your SwiftUI development.

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

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.

There is also a Demo project available where you can see full demonstrations of all backports and additional features, including reference code to help you get started.

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


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.



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 of pure types, can easily be discovered under the Backport namespace. Similarly, modifiers are discoverable under the .backport namespace.

Unfortuantely Environment backports cannot be access this way, in those cases the Apple API values will be prefixed with backport to simplify discovery.


private var filterEnabled: Bool = false


Button("Show Prompt") {
    showPrompt = true
.sheet(isPresented: $showPrompt) {
        .backport.presentationDetents([.medium, .large])


@Environment(\.backportRefresh) private var refreshAction



  • AsyncImage
  • AppStorage
  • background – ViewBuilder API
  • DismissAction
  • DynamicTypeSize – Label – LabeledContent
  • NavigationDestination – uses a standard NavigationView
  • navigationTitle – newer API
  • overlay – ViewBuilder API
  • onChange
  • openURL
  • ProgressView
  • presentationDetents
  • presentationDragIndicator
  • quicklookPreview
  • requestReview
  • Refreshable – includes pull-to-refreshΒ 
  • ScaledMetric
  • ShareLink
  • StateObject
  • scrollDisabled
  • scrollDismissesKeyboard
  • scrollIndicators
  • Section(_ header:)
  • task – async/await modifier


  • UIHostingConfiguration – simplifies embedding SwiftUI in UICollectionViewCell and UITableViewCell


Modal Presentations

Adding this to your presented view, you can use the provided closure to present an ActionSheet to a user when they attempt to dismiss interactively. You can also use this to disable interactive dismissals entirely.

presentation(isModal: true) { /* attempt */ }


A custom GeometryReader implementation that correctly auto-sizes itself to its content. This is useful in many cases where you need a GeometryReader but don't want it to implicitly take up its parent View's bounds.


A custom ScrollView that respects Spacer's when the content is not scrollable. This is useful when you need to place a view at the edges of your scrollview while its content is small enough to not require scrolling. Another great use case is vertically centered content that becomes top aligned once the content requires scrolling.


A pure SwiftUI implementation of a page-based view, using the native TabView and my custom FittingGeometryReader to size itself correctly. Since this uses a TabView under-the-hood, this allows you to use the same APIs and features from that view.


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


  • Swift Tools 5.6.0
View More Packages from this Author


  • None
Last updated: Wed May 29 2024 19:21:28 GMT-0900 (Hawaii-Aleutian Daylight Time)