Skip to content

Commit

Permalink
feat: visionOS support (#3058)
Browse files Browse the repository at this point in the history
  • Loading branch information
atierian authored and thisisabhash committed Feb 14, 2024
1 parent 3c7fec5 commit c5dcb4b
Show file tree
Hide file tree
Showing 52 changed files with 472 additions and 292 deletions.
3 changes: 3 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/AWSAPIPlugin.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
ReferencedContainer = "container:">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "AWSRESTOperationTests/testGetReturnsOperation()">
</Test>
<Test
Identifier = "AWSRESTOperationTests/testRESTOperationConstructURLFailure()">
</Test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@
ReferencedContainer = "container:">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "ModelCompareTests/testTodosAreEqualWithSameEmbeddedableCollection()">
</Test>
<Test
Identifier = "MutationEventExtensionsTest">
</Test>
Expand Down Expand Up @@ -652,6 +655,11 @@
BlueprintName = "AmplifyTests"
ReferencedContainer = "container:">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "ModelCodableTests/testToJSON()">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
skipped = "NO">
Expand Down
3 changes: 3 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/Amplify.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<Test
Identifier = "DataStoreCategoryConfigurationTests/testPreconditionFailureInvokingWithMultiplePlugins()">
</Test>
<Test
Identifier = "ModelCodableTests/testToJSON()">
</Test>
<Test
Identifier = "StorageCategoryConfigurationTests">
</Test>
Expand Down
4 changes: 2 additions & 2 deletions Amplify/Core/Configuration/Internal/Amplify+Reset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ extension Amplify {
ModelListDecoderRegistry.reset()
ModelProviderRegistry.reset()
log.verbose("Resetting ModelRegistry, ModelListDecoderRegistry, ModelProviderRegistry finished")

#if os(iOS)
#if os(iOS) && !os(xrOS)
await MainActor.run {
devMenu = nil
}
Expand Down
4 changes: 3 additions & 1 deletion Amplify/Core/Support/DeviceInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public struct DeviceInfo {
///
/// - Tag: DeviceInfo.screenBounds
public var screenBounds: CGRect {
#if canImport(WatchKit)
#if os(xrOS)
.zero
#elseif canImport(WatchKit)
.zero
#elseif canImport(UIKit)
UIScreen.main.nativeBounds
Expand Down
4 changes: 2 additions & 2 deletions Amplify/DevMenu/Amplify+DevMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// Extension of `Amplify` for supporting Developer Menu feature
extension Amplify {
#if os(iOS)
#if os(iOS) && !os(xrOS)
static var devMenu: AmplifyDevMenu?

@MainActor
Expand All @@ -30,7 +30,7 @@ extension Amplify {

/// Returns a `PersistentLoggingPlugin` if developer menu feature is enabled in debug mode
static func getLoggingCategoryPlugin(loggingPlugin: LoggingCategoryPlugin) -> LoggingCategoryPlugin {
#if os(iOS)
#if os(iOS) && !os(xrOS)
#if DEBUG
if isDevMenuEnabled() {
return PersistentLoggingPlugin(plugin: loggingPlugin)
Expand Down
2 changes: 1 addition & 1 deletion Amplify/DevMenu/AmplifyDevMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0
//

#if os(iOS)
#if os(iOS) && !os(xrOS)
import Foundation
import SwiftUI
import UIKit
Expand Down
2 changes: 1 addition & 1 deletion Amplify/DevMenu/View/DetailViewFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0
//

#if os(iOS)
#if os(iOS) && !os(xrOS)
import SwiftUI

/// A factory to create detail views based on `DevMenuItemType`
Expand Down
2 changes: 1 addition & 1 deletion Amplify/DevMenu/View/DevMenuList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0
//

#if os(iOS)
#if os(iOS) && !os(xrOS)
import SwiftUI

/// View containing a list of developer menu items
Expand Down
4 changes: 2 additions & 2 deletions Amplify/DevMenu/View/IssueReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
//

import SwiftUI
#if os(iOS)
#if os(iOS) && !os(xrOS)
import UIKit
#elseif canImport(AppKit)
import AppKit
#endif

/// Issue report screen in developer menu
#if os(iOS)
#if os(iOS) && !os(xrOS)
struct IssueReporter: View {
@State var issueDescription: String = ""
@State var includeLogs = true
Expand Down
Loading

0 comments on commit c5dcb4b

Please sign in to comment.