Skip to content

Drop AR components from Catalyst #956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Examples/Examples/FlyoverExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ArcGIS
import ArcGISToolkit
import SwiftUI

@available(macCatalyst, unavailable)
struct FlyoverExampleView: View {
@State private var scene = Scene(
item: PortalItem(
Expand Down
1 change: 1 addition & 0 deletions Examples/Examples/TableTopExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ArcGIS
import ArcGISToolkit
import SwiftUI

@available(macCatalyst, unavailable)
struct TableTopExampleView: View {
@State private var scene: ArcGIS.Scene = {
// Creates a scene layer from buildings REST service.
Expand Down
1 change: 1 addition & 0 deletions Examples/Examples/WorldScaleExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import SwiftUI
/// An example that utilizes the `WorldScaleSceneView` to show an augmented reality view
/// of your current location. Because this is an example that can be run from anywhere,
/// it places a red circle around your initial location which can be explored.
@available(macCatalyst, unavailable)
struct WorldScaleExampleView: View {
@State private var scene: ArcGIS.Scene = {
// Creates an elevation source from Terrain3D REST service.
Expand Down
19 changes: 14 additions & 5 deletions Examples/ExamplesApp/Examples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ import SwiftUI

struct Examples: View {
/// The list of example lists. Allows for a hierarchical navigation model for examples.
let lists: [ExampleList] = [
.augmentedReality,
.geoview,
.views
]
let lists = makeExamples()

var body: some View {
NavigationStack {
Expand All @@ -31,9 +27,22 @@ struct Examples: View {
.navigationBarTitleDisplayMode(.inline)
}
}

static func makeExamples() -> [ExampleList] {
let common: [ExampleList] = [
.geoview,
.views
]
#if !targetEnvironment(macCatalyst)
return [.augmentedReality] + common
#else
return common
#endif
}
}

extension ExampleList {
@available(macCatalyst, unavailable)
static let augmentedReality = Self(
name: "Augmented Reality",
examples: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import SwiftUI
import ArcGIS

/// A scene view that provides an augmented reality fly over experience.
@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
public struct FlyoverSceneView: View {
#if os(iOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import SwiftUI
import ArcGIS

/// A scene view that provides an augmented reality table top experience.
@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
public struct TableTopSceneView: View {
#if os(iOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class WorldScaleCalibrationViewModel: ObservableObject {
}
}

@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
extension WorldScaleSceneView {
/// A view that allows the user to calibrate the heading of the scene view camera controller.
Expand Down Expand Up @@ -179,6 +180,7 @@ extension WorldScaleSceneView {
}
}

@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
private extension WorldScaleSceneView.CalibrationView {
var calibrationLabel: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import ArcGIS
import CoreLocation

/// A scene view that provides an augmented reality world scale experience.
@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
public struct WorldScaleSceneView: View {
/// The clipping distance of the scene view.
Expand Down Expand Up @@ -296,6 +297,7 @@ public struct WorldScaleSceneView: View {
#endif
}

@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
public extension WorldScaleSceneView {
/// The type of tracking configuration used by the view.
Expand Down Expand Up @@ -329,6 +331,7 @@ private extension ARGeoTrackingConfiguration {
}
#endif

@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
private extension WorldScaleSceneView {
var calibrateLabel: String {
Expand All @@ -342,6 +345,7 @@ private extension WorldScaleSceneView {
}
}

@available(macCatalyst, unavailable)
@available(visionOS, unavailable)
public extension WorldScaleSceneView {
#if os(iOS)
Expand Down
2 changes: 1 addition & 1 deletion Tests/ArcGISToolkitTests/ARTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if !os(visionOS)
#if !os(visionOS) && !targetEnvironment(macCatalyst)
import ArcGIS
import SwiftUI
import XCTest
Expand Down