Skip to content

Commit

Permalink
Merge pull request #956 from Esri/df/889
Browse files Browse the repository at this point in the history
Drop AR components from Catalyst
  • Loading branch information
dfeinzimer authored Nov 7, 2024
2 parents 9afd05d + 39a46d0 commit 5c5929d
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 6 deletions.
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

0 comments on commit 5c5929d

Please sign in to comment.