Skip to content

Commit e6a84f3

Browse files
authored
MOB-12033 Renamed CoreData method for iOS 26 compatibility (#954)
1 parent c76b073 commit e6a84f3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

swift-sdk/Internal/CoreDataUtil.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ struct CoreDataUtil {
7474
}
7575

7676
extension NSManagedObjectContext {
77-
func performAndWait<T>(_ block: () throws -> T) throws -> T {
77+
@available(iOS, obsoleted: 15.0, message: "This method is intended for older versions of iOS")
78+
func performActionAndWait<T>(_ block: () throws -> T) throws -> T {
7879
var result: Result<T, Error>?
7980
performAndWait {
8081
result = Result { try block() }

swift-sdk/Internal/IterableCoreDataPersistence.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ struct CoreDataPersistenceContext: IterablePersistenceContext {
186186
}
187187

188188
func performAndWait<T>(_ block: () throws -> T) throws -> T {
189-
try managedObjectContext.performAndWait(block)
189+
if #available(iOS 15.0, *) {
190+
try managedObjectContext.performAndWait(block)
191+
} else {
192+
try managedObjectContext.performActionAndWait(block)
193+
}
190194
}
191195

192196
private let managedObjectContext: NSManagedObjectContext

0 commit comments

Comments
 (0)