diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 5dd1529f01..8124cdadfc 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: target: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, watchos, watchsimulator, maccatalyst] - xcode: ["14.3.1"] + xcode: ["15.1"] include: - target: xros xcode: "15.2.0" diff --git a/.github/workflows/master-push.yml b/.github/workflows/master-push.yml index de84ea0260..ae79213cb0 100644 --- a/.github/workflows/master-push.yml +++ b/.github/workflows/master-push.yml @@ -6,15 +6,13 @@ on: - "master" - "release/**" env: - XCODE_VERSION: "['14.2', '14.3.1', '15.1', '15.2', '15.3']" - # Github actions doesn't have Xcode 15.3 on any runners yet, so we can't run - # installation tests for it - XCODE_TEST_VERSIONS: "['14.2', '14.3.1', '15.1', '15.2']" + XCODE_VERSION: "['15.1', '15.2', '15.3']" + XCODE_TEST_VERSIONS: "['15.1', '15.2', '15.3']" PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']" BUILD_PLATFORM: "['ios', 'iossimulator', 'osx', 'watchos', 'watchossimulator', 'tvos', 'tvossimulator', 'catalyst', 'visionos', 'visionossimulator']" - DOC_VERSION: '15.2' - RELEASE_VERSION: '15.2' - TEST_VERSION: '15.2' + DOC_VERSION: '15.3' + RELEASE_VERSION: '15.3' + TEST_VERSION: '15.3' jobs: cleanup: # Clean-up XCode cloud workflows, before running the pipeline runs-on: ubuntu-latest @@ -108,14 +106,6 @@ jobs: configuration: static - platform: visionossimulator configuration: static - - platform: visionos - xcode-version: 14.2 - - platform: visionossimulator - xcode-version: 14.2 - - platform: visionos - xcode-version: 14.3.1 - - platform: visionossimulator - xcode-version: 14.3.1 - platform: visionos xcode-version: 15.1 - platform: visionossimulator @@ -189,10 +179,6 @@ jobs: platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }} xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} exclude: - - platform: visionos - xcode-version: 14.2 - - platform: visionos - xcode-version: 14.3.1 - platform: visionos xcode-version: 15.1 steps: diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 0c5fa6a415..cc9507b622 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,8 +1,8 @@ name: Publish release on: workflow_dispatch env: - XCODE_VERSION: "['14.2', '14.3.1', '15.1', '15.2', '15.3']" - TEST_XCODE_VERSION: '15.2' + XCODE_VERSION: "['15.1', '15.2', '15.3']" + TEST_XCODE_VERSION: '15.3' jobs: prepare: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index ad74450074..e55d39e713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ x.y.z Release notes (yyyy-MM-dd) ============================================================= + +Drop support for Xcode 14, as it can no longer be used to submit app to the app +store. Xcode 15.1 is now the minimum supported version. + ### Enhancements * Added `SyncConfiguration.initialSubscriptions` which describes the initial subscription configuration that was passed when constructing the diff --git a/Configuration/Base.xcconfig b/Configuration/Base.xcconfig index f19525321b..3e63b83ddd 100644 --- a/Configuration/Base.xcconfig +++ b/Configuration/Base.xcconfig @@ -66,17 +66,12 @@ MACOSX_DEPLOYMENT_TARGET_1400 = 10.13; MACOSX_DEPLOYMENT_TARGET_1500 = 10.14; MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR)); WATCHOS_DEPLOYMENT_TARGET_1400 = 4.0; -WATCHOS_DEPLOYMENT_TARGET_1500 = 5.0; +WATCHOS_DEPLOYMENT_TARGET_1500 = 4.0; WATCHOS_DEPLOYMENT_TARGET = $(WATCHOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR)); TVOS_DEPLOYMENT_TARGET_1400 = 11.0; TVOS_DEPLOYMENT_TARGET_1500 = 12.0; TVOS_DEPLOYMENT_TARGET = $(TVOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR)); -REALM_LD_CLASSIC_1400 = ; -REALM_LD_CLASSIC_1500 = -Wl,-ld_classic; -REALM_LD_CLASSIC = $(REALM_LD_CLASSIC_$(XCODE_VERSION_MAJOR)); -OTHER_LDFLAGS = $(REALM_LD_CLASSIC); - APPLICATION_EXTENSION_API_ONLY = YES; REALM_MACH_O_TYPE = mh_dylib; SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator xros xrsimulator; diff --git a/Configuration/Realm/Realm.xcconfig b/Configuration/Realm/Realm.xcconfig index 1eb5582b51..a3961361eb 100644 --- a/Configuration/Realm/Realm.xcconfig +++ b/Configuration/Realm/Realm.xcconfig @@ -17,5 +17,5 @@ LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) @executable_path/../Framewor LINKER_FLAG_MACCATALYST_YES = -framework UIKit; LINKER_FLAG_MACCATALYST_NO = ; -OTHER_LDFLAGS = $(REALM_SYMBOLS_FLAGS) $(REALM_LD_CLASSIC) -framework UIKit; -OTHER_LDFLAGS[sdk=macosx*] = $(REALM_SYMBOLS_FLAGS) $(REALM_LD_CLASSIC) $(LINKER_FLAG_MACCATALYST_$(IS_MACCATALYST)); +OTHER_LDFLAGS = $(REALM_SYMBOLS_FLAGS) -framework UIKit; +OTHER_LDFLAGS[sdk=macosx*] = $(REALM_SYMBOLS_FLAGS) $(LINKER_FLAG_MACCATALYST_$(IS_MACCATALYST)); diff --git a/Package.swift b/Package.swift index a239efdd77..67ca030c85 100644 --- a/Package.swift +++ b/Package.swift @@ -140,8 +140,8 @@ let package = Package( name: "Realm", platforms: [ .macOS(.v10_13), - .iOS(.v11), - .tvOS(.v11), + .iOS(.v12), + .tvOS(.v12), .watchOS(.v4) ], products: [ diff --git a/Realm.podspec b/Realm.podspec index c93224dc08..40770ea24e 100644 --- a/Realm.podspec +++ b/Realm.podspec @@ -134,27 +134,24 @@ Pod::Spec.new do |s| 'IPHONEOS_DEPLOYMENT_TARGET_1500' => '12.0', 'IPHONEOS_DEPLOYMENT_TARGET' => '$(IPHONEOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', 'MACOSX_DEPLOYMENT_TARGET_1400' => '10.13', - 'MACOSX_DEPLOYMENT_TARGET_1500' => '10.14', + 'MACOSX_DEPLOYMENT_TARGET_1500' => '10.13', 'MACOSX_DEPLOYMENT_TARGET' => '$(MACOSX_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', 'WATCHOS_DEPLOYMENT_TARGET_1400' => '4.0', - 'WATCHOS_DEPLOYMENT_TARGET_1500' => '5.0', + 'WATCHOS_DEPLOYMENT_TARGET_1500' => '4.0', 'WATCHOS_DEPLOYMENT_TARGET' => '$(WATCHOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', 'TVOS_DEPLOYMENT_TARGET_1400' => '11.0', 'TVOS_DEPLOYMENT_TARGET_1500' => '12.0', 'TVOS_DEPLOYMENT_TARGET' => '$(TVOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', - 'REALM_LD_CLASSIC_1400' => '', - 'REALM_LD_CLASSIC_1500' => '-Wl,-ld_classic', - 'REALM_LD_CLASSIC' => '$(REALM_LD_CLASSIC_$(XCODE_VERSION_MAJOR))', - 'OTHER_LDFLAGS' => '$(REALM_LD_CLASSIC) "-Wl,-unexported_symbols_list,${PODS_ROOT}/Realm/Configuration/Realm/PrivateSymbols.txt"', + 'OTHER_LDFLAGS' => '"-Wl,-unexported_symbols_list,${PODS_ROOT}/Realm/Configuration/Realm/PrivateSymbols.txt"', } s.preserve_paths = %w(include scripts Configuration/Realm/PrivateSymbols.txt) s.resource_bundles = {'realm_objc_privacy' => ['Realm/PrivacyInfo.xcprivacy']} - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.13' s.watchos.deployment_target = '4.0' - s.tvos.deployment_target = '11.0' + s.tvos.deployment_target = '12.0' s.vendored_frameworks = 'core/realm-monorepo.xcframework' diff --git a/Realm/ObjectServerTests/RealmServer.swift b/Realm/ObjectServerTests/RealmServer.swift index ea68afc070..c73e78b1e7 100644 --- a/Realm/ObjectServerTests/RealmServer.swift +++ b/Realm/ObjectServerTests/RealmServer.swift @@ -49,7 +49,6 @@ extension URLSession { } // Synchronously perform a data task, returning the data from it - @available(macOS 10.12, *) fileprivate func resultDataTask(with request: URLRequest) -> Result { let result = Locked(Result?.none) let group = DispatchGroup() @@ -125,10 +124,6 @@ private extension Property { } } -// Swift 5.8 complains if collections are inferred as having type Any and adding -// explicit types everywhere makes things awful, but this doesn't quite work on -// older versions of Swift -#if swift(>=5.8) internal protocol Json {} extension Bool: Json {} extension Int: Json {} @@ -138,9 +133,6 @@ extension Double: Json {} extension Dictionary: Json where Key == String, Value == Json {} extension Array: Json where Element == Json {} extension Optional: Json where Wrapped: Json {} -#else -typealias Json = Any -#endif private extension ObjectSchema { func stitchRule(_ partitionKeyType: String?, id: String? = nil, appId: String) -> [String: Json] { @@ -218,7 +210,6 @@ private extension DispatchGroup { // MARK: AdminSession /// An authenticated session for using the Admin API -@available(macOS 10.12, *) class AdminSession { /// The access token of the authenticated user var accessToken: String @@ -425,7 +416,6 @@ class AdminSession { } // MARK: - Admin -@available(macOS 10.12, *) class Admin { private func userProfile(accessToken: String) -> Result { var request = URLRequest(url: URL(string: "http://localhost:9090/api/admin/v3.0/auth/profile")!) @@ -482,7 +472,6 @@ public enum SyncMode { A sandboxed server. This singleton launches and maintains all server processes and allows for app creation. */ -@available(OSX 10.13, *) @objc(RealmServer) public class RealmServer: NSObject { public enum LogLevel: Sendable { diff --git a/Realm/ObjectServerTests/SwiftAsymmetricSyncServerTests.swift b/Realm/ObjectServerTests/SwiftAsymmetricSyncServerTests.swift index 2a9fe4ac59..2cfd294aed 100644 --- a/Realm/ObjectServerTests/SwiftAsymmetricSyncServerTests.swift +++ b/Realm/ObjectServerTests/SwiftAsymmetricSyncServerTests.swift @@ -183,7 +183,6 @@ class SwiftAsymmetricSyncTests: SwiftSyncTestCase { } } -#if swift(>=5.8) @available(macOS 13.0, *) extension SwiftAsymmetricSyncTests { @MainActor @@ -297,5 +296,4 @@ extension SwiftAsymmetricSyncTests { XCTAssertEqual(document!["custom_stringCol"], AnyBSON("$%&/(")) } } -#endif // canImport(_Concurrency) #endif // os(macOS) diff --git a/Realm/ObjectServerTests/SwiftMongoClientTests.swift b/Realm/ObjectServerTests/SwiftMongoClientTests.swift index 27141fcc05..ee770738f8 100644 --- a/Realm/ObjectServerTests/SwiftMongoClientTests.swift +++ b/Realm/ObjectServerTests/SwiftMongoClientTests.swift @@ -738,11 +738,6 @@ class SwiftMongoClientTests: SwiftSyncTestCase { watchTestUtility.waitForClose() } -#if swift(>=5.8) - // wait(for:) doesn't work in async functions because it blocks the calling - // thread and doesn't let async tasks run. Xcode 14.3 introduced a new async - // version of it which does work, but there doesn't appear to be a workaround - // for older Xcode versions. @available(macOS 13, *) func performAsyncWatchTest(filterIds: Bool = false, matchFilter: Bool = false) async throws { let collection = setupMongoCollection() @@ -802,7 +797,6 @@ class SwiftMongoClientTests: SwiftSyncTestCase { func testWatchWithFilterIdsAsync() async throws { try await performAsyncWatchTest(filterIds: true) } -#endif func testWatchMultipleFilterStreams() throws { try performMultipleWatchStreamsTest(nil) @@ -868,7 +862,6 @@ class SwiftMongoClientTests: SwiftSyncTestCase { } } -#if swift(>=5.8) // MARK: - AsyncAwaitMongoClientTests @available(macOS 13, *) class AsyncAwaitMongoClientTests: SwiftSyncTestCase { @@ -1247,6 +1240,5 @@ class AsyncAwaitMongoClientTests: SwiftSyncTestCase { XCTAssertEqual(count5, 1) } } -#endif #endif // os(macOS) diff --git a/Realm/ObjectServerTests/SwiftSyncTestCase.swift b/Realm/ObjectServerTests/SwiftSyncTestCase.swift index d892c57014..a0d9250db4 100644 --- a/Realm/ObjectServerTests/SwiftSyncTestCase.swift +++ b/Realm/ObjectServerTests/SwiftSyncTestCase.swift @@ -217,7 +217,6 @@ open class SwiftSyncTestCase: RLMSyncTestCase { XCTAssertEqual(collection.count(filter: [:]).await(self), count) } -#if swift(>=5.8) // MARK: - Async helpers // These are async versions of the synchronous functions defined above. @@ -254,7 +253,6 @@ open class SwiftSyncTestCase: RLMSyncTestCase { let credentials = try await basicCredentials(app: app) return try await (app ?? self.app).login(credentials: credentials) } -#endif // swift(>=5.8) } @available(macOS 10.15, watchOS 6.0, iOS 13.0, tvOS 13.0, *) diff --git a/RealmSwift.podspec b/RealmSwift.podspec index ba9ba73454..4591e45ed4 100644 --- a/RealmSwift.podspec +++ b/RealmSwift.podspec @@ -16,10 +16,10 @@ Pod::Spec.new do |s| s.social_media_url = 'https://twitter.com/realm' s.documentation_url = "https://docs.mongodb.com/realm/sdk/swift" s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.13' s.watchos.deployment_target = '4.0' - s.tvos.deployment_target = '11.0' + s.tvos.deployment_target = '12.0' s.preserve_paths = %w(build.sh) s.swift_version = '5' @@ -37,18 +37,13 @@ Pod::Spec.new do |s| 'IPHONEOS_DEPLOYMENT_TARGET_1500' => '12.0', 'IPHONEOS_DEPLOYMENT_TARGET' => '$(IPHONEOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', 'MACOSX_DEPLOYMENT_TARGET_1400' => '10.13', - 'MACOSX_DEPLOYMENT_TARGET_1500' => '10.14', + 'MACOSX_DEPLOYMENT_TARGET_1500' => '10.13', 'MACOSX_DEPLOYMENT_TARGET' => '$(MACOSX_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', 'WATCHOS_DEPLOYMENT_TARGET_1400' => '4.0', - 'WATCHOS_DEPLOYMENT_TARGET_1500' => '5.0', + 'WATCHOS_DEPLOYMENT_TARGET_1500' => '4.0', 'WATCHOS_DEPLOYMENT_TARGET' => '$(WATCHOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', 'TVOS_DEPLOYMENT_TARGET_1400' => '11.0', 'TVOS_DEPLOYMENT_TARGET_1500' => '12.0', 'TVOS_DEPLOYMENT_TARGET' => '$(TVOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))', - - 'REALM_LD_CLASSIC_1400' => '', - 'REALM_LD_CLASSIC_1500' => '-Wl,-ld_classic', - 'REALM_LD_CLASSIC' => '$(REALM_LD_CLASSIC_$(XCODE_VERSION_MAJOR))', - 'OTHER_LDFLAGS' => '$(REALM_LD_CLASSIC)', } end diff --git a/RealmSwift/Aliases.swift b/RealmSwift/Aliases.swift index 7210b56713..ac9e192bef 100644 --- a/RealmSwift/Aliases.swift +++ b/RealmSwift/Aliases.swift @@ -86,7 +86,6 @@ extension ObjectBase { } } -#if swift(>=5.8) @available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *) internal func _observe( keyPaths: [String]? = nil, on actor: isolated A, @@ -104,5 +103,4 @@ extension ObjectBase { onCancel: { token.invalidate() }) return token } -#endif // swift(>=5.8) } diff --git a/RealmSwift/EmbeddedObject.swift b/RealmSwift/EmbeddedObject.swift index 4cf8a135d7..9034d864dd 100644 --- a/RealmSwift/EmbeddedObject.swift +++ b/RealmSwift/EmbeddedObject.swift @@ -217,7 +217,6 @@ extension EmbeddedObject: _RealmCollectionValueInsideOptional { return _observe(on: queue, block) } -#if swift(>=5.8) /** Registers a block to be called each time the object changes. @@ -303,7 +302,6 @@ extension EmbeddedObject: _RealmCollectionValueInsideOptional { ) async -> NotificationToken { await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block) } -#endif // swift(>=5.8) // MARK: Dynamic list diff --git a/RealmSwift/Impl/RealmCollectionImpl.swift b/RealmSwift/Impl/RealmCollectionImpl.swift index 8792250f56..5957147b25 100644 --- a/RealmSwift/Impl/RealmCollectionImpl.swift +++ b/RealmSwift/Impl/RealmCollectionImpl.swift @@ -120,7 +120,6 @@ extension RealmCollectionImpl { return collection.addNotificationBlock(wrapped, keyPaths: keyPaths, queue: queue) } -#if swift(>=5.8) @available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *) @_unsafeInheritExecutor public func observe( @@ -135,7 +134,6 @@ extension RealmCollectionImpl { } } ?? NotificationToken() } -#endif public var isFrozen: Bool { return collection.isFrozen @@ -170,7 +168,6 @@ extension Optional: OptionalProtocol { public func _rlmInferWrappedType() -> Wrapped { return self! } } -#if swift(>=5.8) // `with(object, on: actor) { object, actor in ... }` hands the object over // to the given actor and then invokes the callback within the actor. // This might make sense to expose publicly. @@ -221,4 +218,3 @@ internal func with( #endif } } -#endif diff --git a/RealmSwift/Map.swift b/RealmSwift/Map.swift index 2f5d51a4a7..64f1422355 100644 --- a/RealmSwift/Map.swift +++ b/RealmSwift/Map.swift @@ -520,7 +520,6 @@ public final class Map: RLMSwiftColle return rlmDictionary.addNotificationBlock(wrapped, keyPaths: keyPaths, queue: queue) } -#if swift(>=5.8) /** Registers a block to be called each time the map changes. @@ -699,7 +698,6 @@ public final class Map: RLMSwiftColle ) async -> NotificationToken where Value: OptionalProtocol, Value.Wrapped: ObjectBase { await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block) } -#endif // MARK: Frozen Objects diff --git a/RealmSwift/Object.swift b/RealmSwift/Object.swift index ab98a5b132..99a218b1f6 100644 --- a/RealmSwift/Object.swift +++ b/RealmSwift/Object.swift @@ -406,7 +406,6 @@ extension Object: _RealmCollectionValueInsideOptional { _observe(keyPaths: keyPaths.map(_name(for:)), on: queue, block) } -#if swift(>=5.8) /** Registers a block to be called each time the object changes. @@ -492,7 +491,6 @@ extension Object: _RealmCollectionValueInsideOptional { ) async -> NotificationToken { await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block) } -#endif // swift(>=5.8) // MARK: Dynamic list diff --git a/RealmSwift/Projection.swift b/RealmSwift/Projection.swift index a655ca5b1c..60a4101765 100644 --- a/RealmSwift/Projection.swift +++ b/RealmSwift/Projection.swift @@ -458,7 +458,6 @@ extension ProjectionObservable { observe(keyPaths: map(keyPaths: keyPaths), on: queue, block) } -#if swift(>=5.8) /** Registers a block to be called each time the projection's underlying object changes. @@ -622,7 +621,6 @@ extension ProjectionObservable { ) async -> NotificationToken { await observe(keyPaths: map(keyPaths: keyPaths), on: actor, block) } -#endif fileprivate var schema: [ProjectionProperty] { projectionSchemaCache.schema(for: self) diff --git a/RealmSwift/Realm.swift b/RealmSwift/Realm.swift index 4087342755..1c3438f27e 100644 --- a/RealmSwift/Realm.swift +++ b/RealmSwift/Realm.swift @@ -1231,7 +1231,6 @@ extension Realm { self = Realm(rlmRealm.wrappedValue) } -#if swift(>=5.8) /** Asynchronously obtains a `Realm` instance isolated to the given Actor. @@ -1382,7 +1381,6 @@ extension Realm { task.complete(false) } } -#endif } @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @@ -1461,14 +1459,12 @@ extension RLMAsyncDownloadTask: TaskWithCancellation {} @available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *) internal extension Actor { func verifier() -> (@Sendable () -> Void) { -#if swift(>=5.9) // When possible use the official API for actor checking if #available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) { return { self.preconditionIsolated() } } -#endif // This exploits a hole in Swift's type system to construct a function // which is isolated to the current actor, and then casts away that diff --git a/RealmSwift/RealmCollection.swift b/RealmSwift/RealmCollection.swift index 495704c6bb..e9e1140adf 100644 --- a/RealmSwift/RealmCollection.swift +++ b/RealmSwift/RealmCollection.swift @@ -523,7 +523,6 @@ public protocol RealmCollection: RealmCollectionBase, Equatable where Iterator = on queue: DispatchQueue?, _ block: @escaping (RealmCollectionChange) -> Void) -> NotificationToken -#if swift(>=5.8) /** Registers a block to be called each time the collection changes. @@ -621,7 +620,6 @@ public protocol RealmCollection: RealmCollectionBase, Equatable where Iterator = func observe(keyPaths: [String]?, on actor: A, _ block: @Sendable @escaping (isolated A, RealmCollectionChange) -> Void) async -> NotificationToken -#endif // MARK: Frozen Objects @@ -1128,7 +1126,6 @@ public extension RealmCollection { return self.observe(keyPaths: keyPaths, on: queue, block) } -#if swift(>=5.8) /** Registers a block to be called each time the collection changes. @@ -1228,7 +1225,6 @@ public extension RealmCollection { _ block: @Sendable @escaping (isolated A, RealmCollectionChange) -> Void) async -> NotificationToken { await self.observe(keyPaths: keyPaths, on: actor, block) } -#endif } public extension RealmCollection where Element: ObjectBase { @@ -1352,7 +1348,6 @@ public extension RealmCollection where Element: ObjectBase { return self.observe(keyPaths: keyPaths.map(_name(for:)), on: queue, block) } -#if swift(>=5.8) /** Registers a block to be called each time the collection changes. @@ -1451,7 +1446,6 @@ public extension RealmCollection where Element: ObjectBase { _ block: @Sendable @escaping (isolated A, RealmCollectionChange) -> Void) async -> NotificationToken { await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block) } -#endif } extension RealmCollection { diff --git a/RealmSwift/Results.swift b/RealmSwift/Results.swift index e0f419d2ee..6b0d74afa8 100644 --- a/RealmSwift/Results.swift +++ b/RealmSwift/Results.swift @@ -149,7 +149,6 @@ extension Projection: KeypathSortable {} // MARK: Flexible Sync -#if swift(>=5.8) /** Creates a SyncSubscription matching the Results' local query. After committing the subscription to the realm's local subscription set, the method @@ -195,7 +194,6 @@ extension Projection: KeypathSortable {} rlmResults = try await rlmResults.subscribe(withName: name, waitForSync: waitForSync, confinedTo: scheduler, timeout: timeout ?? 0) return self } -#endif /** Removes a SyncSubscription matching the Results' local filter. diff --git a/RealmSwift/SectionedResults.swift b/RealmSwift/SectionedResults.swift index b27d1486ab..acbe569411 100644 --- a/RealmSwift/SectionedResults.swift +++ b/RealmSwift/SectionedResults.swift @@ -198,7 +198,6 @@ public extension RealmSectionedResult { observe(keyPaths: keyPaths, on: queue, block) } -#if swift(>=5.8) @available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *) @_unsafeInheritExecutor func observe( @@ -213,7 +212,6 @@ public extension RealmSectionedResult { } } ?? NotificationToken() } -#endif } public extension RealmSectionedResult where Element: RealmSectionedResult, Element.Element: ObjectBase { @@ -341,7 +339,6 @@ public extension RealmSectionedResult where Element: RealmSectionedResult, Eleme observe(keyPaths: keyPaths.map(_name(for:)), on: queue, block) } -#if swift(>=5.8) @available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *) @_unsafeInheritExecutor func observe( @@ -350,7 +347,6 @@ public extension RealmSectionedResult where Element: RealmSectionedResult, Eleme ) async -> NotificationToken { await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block) } -#endif } public extension RealmSectionedResult where Element: ObjectBase { @@ -478,7 +474,6 @@ public extension RealmSectionedResult where Element: ObjectBase { observe(keyPaths: keyPaths.map(_name(for:)), on: queue, block) } -#if swift(>=5.8) @available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *) @_unsafeInheritExecutor func observe( @@ -487,7 +482,6 @@ public extension RealmSectionedResult where Element: ObjectBase { ) async -> NotificationToken { await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block) } -#endif } // Shared implementation of SectionedResults and ResultsSection diff --git a/RealmSwift/Tests/MapTests.swift b/RealmSwift/Tests/MapTests.swift index 174c5ce29b..fb43509098 100644 --- a/RealmSwift/Tests/MapTests.swift +++ b/RealmSwift/Tests/MapTests.swift @@ -968,7 +968,6 @@ class MapTests: TestCase { token.invalidate() } -#if swift(>=5.8) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @MainActor func testObserveOnActor() async throws { let map = createMapObject().swiftObjectMap @@ -1030,7 +1029,6 @@ class MapTests: TestCase { await fulfillment(of: [changeEx]) token.invalidate() } -#endif // swift(>=5.8) } class MapStandaloneTests: MapTests { @@ -1081,7 +1079,6 @@ class MapStandaloneTests: MapTests { assertThrows(mapObj.observe {_ in }) } -#if swift(>=5.8) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @MainActor override func testObserveOnActor() async throws { } @@ -1089,7 +1086,6 @@ class MapStandaloneTests: MapTests { @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @MainActor override func testObserveOnActorTypedKeyPath() async throws { } -#endif } class MapNewlyAddedTests: MapTests { diff --git a/RealmSwift/Tests/ObjectTests.swift b/RealmSwift/Tests/ObjectTests.swift index a29697d519..2b64850a83 100644 --- a/RealmSwift/Tests/ObjectTests.swift +++ b/RealmSwift/Tests/ObjectTests.swift @@ -1530,7 +1530,6 @@ class ObjectTests: TestCase { queue.sync { } } -#if swift(>=5.8) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) func expectChange(_ obj: T, _ ex: XCTestExpectation, newValue: Int) -> @Sendable (isolated CustomGlobalActor, ObjectChange) -> Void { @@ -1712,7 +1711,6 @@ class ObjectTests: TestCase { XCTAssertEqual(active.value, completed.value) } } -#endif // MARK: Equality Tests diff --git a/RealmSwift/Tests/ProjectionTests.swift b/RealmSwift/Tests/ProjectionTests.swift index e3004966bb..3d8b60e11d 100644 --- a/RealmSwift/Tests/ProjectionTests.swift +++ b/RealmSwift/Tests/ProjectionTests.swift @@ -1590,7 +1590,6 @@ class ProjectionTests: TestCase { observeSetChange(obs, "mapOptUuid") { obj.mapOptUuid.removeObject(for: "key") } } -#if swift(>=5.8) func testObserveOnActor() async throws { let projection = simpleProjection() let ex = expectation(description: "got change") @@ -1623,7 +1622,6 @@ class ProjectionTests: TestCase { await fulfillment(of: [ex]) tokens.forEach { $0.invalidate() } } -#endif // MARK: Frozen Objects diff --git a/RealmSwift/Tests/RealmCollectionTypeTests.swift b/RealmSwift/Tests/RealmCollectionTypeTests.swift index 796a2f48b3..94e2d58f4b 100644 --- a/RealmSwift/Tests/RealmCollectionTypeTests.swift +++ b/RealmSwift/Tests/RealmCollectionTypeTests.swift @@ -655,7 +655,6 @@ class RealmCollectionTests=5.8) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) private actor TestActor { private var gotInitial = false @@ -799,8 +798,6 @@ class RealmCollectionTests=5.8) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) override func testCancelTaskForObservationInit() async throws {} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @@ -1758,7 +1754,6 @@ class ListUnmanagedRealmCollectionTests: ListRealmCollectionTests { override func testObserveOnActorWithStringKeyPath() async throws {} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) override func testObserveOnActorWithKeyPath() async throws {} -#endif override func testObserveKeyPath() { assertThrows(collection.observe { _ in }) @@ -2001,7 +1996,6 @@ class MutableSetUnmanagedRealmCollectionTests: MutableSetRealmCollectionTests { assertThrows(collection.observe { _ in }) } -#if swift(>=5.8) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) override func testCancelTaskForObservationInit() async throws {} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @@ -2012,7 +2006,6 @@ class MutableSetUnmanagedRealmCollectionTests: MutableSetRealmCollectionTests { override func testObserveOnActorWithStringKeyPath() async throws {} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) override func testObserveOnActorWithKeyPath() async throws {} -#endif override func testObserveOnQueue() { assertThrows(collection.observe(on: DispatchQueue(label: "bg")) { _ in }) diff --git a/RealmSwift/Tests/RealmTests.swift b/RealmSwift/Tests/RealmTests.swift index 9f566b3fc2..b476cd47b1 100644 --- a/RealmSwift/Tests/RealmTests.swift +++ b/RealmSwift/Tests/RealmTests.swift @@ -1492,8 +1492,6 @@ class RealmTests: TestCase { @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @available(*, deprecated) // Silence deprecation warnings for RealmOptional extension RealmTests { -#if swift(>=5.8) - @MainActor func testOpenBehaviorForLocalRealm() async throws { let realm = try await Realm(downloadBeforeOpen: .always) @@ -1889,7 +1887,6 @@ extension RealmTests { } realm.cancelWrite() } -#endif // swift(>=5.8) } @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) diff --git a/RealmSwift/Tests/TestUtils.swift b/RealmSwift/Tests/TestUtils.swift index a46259adf6..1cdb49a8bb 100644 --- a/RealmSwift/Tests/TestUtils.swift +++ b/RealmSwift/Tests/TestUtils.swift @@ -31,7 +31,6 @@ import RealmTestSupport // simplify use. Due to a bug in the Swift compiler // (https://github.com/apple/swift/issues/61358), this current doesn't work for // local variables. -@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) @propertyWrapper public class Locked: @unchecked Sendable { private var _value: T @@ -215,7 +214,6 @@ public extension XCTestCase { } } -#if swift(>=5.8) @_unsafeInheritExecutor @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) public func assertThrowsErrorAsync( @@ -288,4 +286,3 @@ public func assertPreconditionFailure(_ message: String, _ expression: () asy XCTFail("Expected \"\(str)\" to contain \"\(message)\")", file: file, line: line) } } -#endif diff --git a/RealmSwift/Util.swift b/RealmSwift/Util.swift index 82abc86785..d5b600db09 100644 --- a/RealmSwift/Util.swift +++ b/RealmSwift/Util.swift @@ -164,11 +164,9 @@ internal func logRuntimeIssue(_ message: StaticString) { internal func assumeOnMainActorExecutor(_ operation: @MainActor () throws -> T, file: StaticString = #fileID, line: UInt = #line ) rethrows -> T { -#if swift(>=5.9) if #available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) { return try MainActor.assumeIsolated(operation) } -#endif precondition(Thread.isMainThread, file: file, line: line) return try withoutActuallyEscaping(operation) { fn in @@ -181,11 +179,9 @@ internal func assumeOnMainActorExecutor(_ operation: @MainActor () throws -> internal func assumeOnActorExecutor(_ actor: A, _ operation: (isolated A) throws -> T ) rethrows -> T { -#if swift(>=5.9) if #available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) { return try actor.assumeIsolated(operation) } -#endif return try withoutActuallyEscaping(operation) { fn in try unsafeBitCast(fn, to: ((A) throws -> T).self)(actor) diff --git a/build.sh b/build.sh index 4a8b186e85..b6655be6b4 100755 --- a/build.sh +++ b/build.sh @@ -1345,7 +1345,7 @@ x.y.z Release notes (yyyy-MM-dd) * APIs are backwards compatible with all previous releases in the 10.x.y series. * Carthage release for Swift is built with Xcode 15.3.0. * CocoaPods: 1.10 or later. -* Xcode: 14.2-15.3.0. +* Xcode: 15.1-15.3.0. ### Internal * Upgraded realm-core from ? to ? diff --git a/scripts/package_examples.rb b/scripts/package_examples.rb index 1c9fd67a5c..4f3c2d06be 100755 --- a/scripts/package_examples.rb +++ b/scripts/package_examples.rb @@ -44,7 +44,7 @@ def replace_framework(example, framework, path) "examples/tvos/swift", ] -xcode_versions = %w(14.2 14.3.1 15.1 15.2 15.3) +xcode_versions = %w(15.1 15.2 15.3) # Remove reference to Realm.xcodeproj from all example workspaces. base_examples.each do |example| diff --git a/scripts/pr-ci-matrix.rb b/scripts/pr-ci-matrix.rb index 4b742bb70b..2690979912 100755 --- a/scripts/pr-ci-matrix.rb +++ b/scripts/pr-ci-matrix.rb @@ -86,7 +86,7 @@ def action # because they don't care about Xcode versions, while some others are latest-only # because they're particularly slow to run. module Workflows - XCODE_VERSIONS = %w(14.2 14.3.1 15.1 15.2 15.3) + XCODE_VERSIONS = %w(15.1 15.2 15.3) all = ->(v) { true } latest_only = ->(v) { v == XCODE_VERSIONS.last }