realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.18k stars 2.14k forks source link

Make Swift Concurrency Realm enhancements available for iOS 13+ #7599

Closed gabrielnica closed 2 years ago

gabrielnica commented 2 years ago

Problem

Currently all the structured concurrency enhancements such as

@MainActor
    public init(configuration: Realm.Configuration = .defaultConfiguration,
                downloadBeforeOpen: OpenBehavior = .never) async throws 

etc. are marked with

@available(iOS 15.0)

Is it possible to add availability for iOS 13 as well? At a first glance it doesn't look like there's any blocker for this change

Solution

Change @available(iOS 15.0) to @available(iOS 13.0) for Concurrency enhancements

How important is this improvement for you?

Dealbreaker

tgoyne commented 2 years ago

Swift concurrency backdeployment currently has some issues (the Mac App Store rejects apps using it, and it bundles the rather large libswift_Concurrency.dylib even if the app itself never calls any of the async functions) which we need to find workarounds for before we can reasonably enable it.

tfe commented 2 years ago

Looks like there is a report here of a macOS app with Swift concurrency back-deployment being accepted as of two days ago.

tgoyne commented 2 years ago

If I understand https://forums.swift.org/t/async-await-crash-on-ios14-with-xcode-13-2-1/54541 correctly then enabling back-deployment will also sometimes result in iOS 14 crashes even if the app isn't using concurrency, so we probably need to wait for 13.2.2.

onelogapp commented 2 years ago

Update: Xcode 13.3 beta fixes this issue @tgoyne

gabrielnica commented 2 years ago

@tgoyne Now that Xcode 13.3 is out, possible to look at this again? Xcode 13.3 fixes the back deployment issue. Thanks