From d2341b9e013da306b137d552a5bbfb740d24d120 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Wed, 9 Aug 2023 13:57:59 -0400 Subject: [PATCH] [Storage] Fix visionOS build on Xcode 15 beta 6 --- FirebaseStorage/Sources/Internal/StorageUtils.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/FirebaseStorage/Sources/Internal/StorageUtils.swift b/FirebaseStorage/Sources/Internal/StorageUtils.swift index 97450734851..168d265d038 100644 --- a/FirebaseStorage/Sources/Internal/StorageUtils.swift +++ b/FirebaseStorage/Sources/Internal/StorageUtils.swift @@ -17,7 +17,17 @@ import Foundation import MobileCoreServices #elseif os(macOS) || os(watchOS) import CoreServices -#endif +#endif // os(iOS) || os(tvOS) + +// swift(>=5.9) implies Xcode 15+ +// Need to have this Swift version check to use os(visionOS) macro, VisionOS support. +// TODO: Remove this check and add `os(visionOS)` to the `os(iOS) || os(tvOS)` conditional above +// when Xcode 15 is the minimum supported by Firebase. +#if swift(>=5.9) + #if os(visionOS) + import MobileCoreServices + #endif // os(visionOS) +#endif // swift(>=5.9) class StorageUtils { internal class func defaultRequestForReference(reference: StorageReference,