Skip to content

Commit df56264

Browse files
authored
[visionOS] Fix Storage SDK build on Xcode 15 beta 6 (#11667)
In Xcode 15 beta 6, `#if os(iOS)` no longer evaluates to true when building for visionOS. Note: `TARGET_OS_IOS` continues to be defined so Objective-C code is unchanged.
1 parent 0e183e0 commit df56264

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

FirebaseStorage/Sources/Internal/StorageUtils.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ import Foundation
1717
import MobileCoreServices
1818
#elseif os(macOS) || os(watchOS)
1919
import CoreServices
20-
#endif
20+
#endif // os(iOS) || os(tvOS)
21+
22+
// swift(>=5.9) implies Xcode 15+
23+
// Need to have this Swift version check to use os(visionOS) macro, VisionOS support.
24+
// TODO: Remove this check and add `os(visionOS)` to the `os(iOS) || os(tvOS)` conditional above
25+
// when Xcode 15 is the minimum supported by Firebase.
26+
#if swift(>=5.9)
27+
#if os(visionOS)
28+
import MobileCoreServices
29+
#endif // os(visionOS)
30+
#endif // swift(>=5.9)
2131

2232
class StorageUtils {
2333
internal class func defaultRequestForReference(reference: StorageReference,

0 commit comments

Comments
 (0)