Skip to content
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

Mark some components as unavailable on visionOS #902

Open
wants to merge 2 commits into
base: visionOS-v.next
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions Sources/ArcGISToolkit/Common/AttachmentList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ArcGIS
import SwiftUI

/// A view displaying a list of attachments, with a thumbnail, title, and download button.
@available(visionOS, unavailable)
struct AttachmentList: View {
/// The attachment models displayed in the list.
var attachmentModels: [AttachmentModel]
Expand All @@ -28,6 +29,7 @@ struct AttachmentList: View {
}

/// A view representing a single row in an `AttachmentList`.
@available(visionOS, unavailable)
struct AttachmentRow: View {
/// The model representing the attachment to display.
@ObservedObject var attachmentModel: AttachmentModel
Expand Down Expand Up @@ -64,6 +66,7 @@ struct AttachmentRow: View {
}

/// View displaying a button used to load an attachment.
@available(visionOS, unavailable)
struct AttachmentLoadButton: View {
@ObservedObject var attachmentModel: AttachmentModel

Expand Down
2 changes: 2 additions & 0 deletions Sources/ArcGISToolkit/Common/AttachmentModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ internal import os

/// A view model representing the combination of a `FeatureAttachment` and
/// an associated `UIImage` used as a thumbnail.
@available(visionOS, unavailable)
@MainActor class AttachmentModel: ObservableObject {
/// The `FeatureAttachment`.
nonisolated let attachment: FeatureAttachment
Expand Down Expand Up @@ -118,4 +119,5 @@ internal import os
}
}

@available(visionOS, unavailable)
extension AttachmentModel: Identifiable {}
3 changes: 3 additions & 0 deletions Sources/ArcGISToolkit/Common/AttachmentPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ArcGIS
import SwiftUI

/// A view displaying a list of attachments in a "carousel", with a thumbnail and title.
@available(visionOS, unavailable)
struct AttachmentPreview: View {
/// An action which scrolls the Carousel to the front.
@Binding var scrollToNewAttachmentAction: (() -> Void)?
Expand Down Expand Up @@ -244,6 +245,7 @@ struct AttachmentPreview: View {
}

/// A view displaying details for popup media.
@available(visionOS, unavailable)
struct ThumbnailViewFooter: View {
/// The popup media to display.
@ObservedObject var attachmentModel: AttachmentModel
Expand Down Expand Up @@ -273,6 +275,7 @@ struct ThumbnailViewFooter: View {
}
}

@available(visionOS, unavailable)
private extension AttachmentPreview.AttachmentCell {
/// An error message explaining attachments larger than the provided maximum cannot be downloaded.
var maximumSizeDownloadExceededErrorMessage: Text {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import SwiftUI

/// A view displaying an `AttachmentsFeatureElement`.
@MainActor
@available(visionOS, unavailable)
struct AttachmentsFeatureElementView: View {
/// The `AttachmentsFeatureElement` to display.
let featureElement: AttachmentsFeatureElement
Expand Down Expand Up @@ -203,6 +204,7 @@ struct AttachmentsFeatureElementView: View {
}
}

@available(visionOS, unavailable)
private extension AttachmentsFeatureElement {
/// Provides a default title to display if `title` is empty.
var displayTitle: String {
Expand All @@ -214,6 +216,7 @@ private extension AttachmentsFeatureElement {
}
}

@available(visionOS, unavailable)
extension AttachmentsFeatureElementView {
/// The size of thumbnail images, based on the attachment display type
/// and the current size class of the view.
Expand All @@ -239,6 +242,7 @@ extension AttachmentsFeatureElementView {
}
}

@available(visionOS, unavailable)
extension View {
/// Modifier for watching `AttachmentsFormElement.isEditable`.
/// - Parameters:
Expand Down
1 change: 1 addition & 0 deletions Sources/ArcGISToolkit/Common/ThumbnailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import SwiftUI

/// A view displaying a thumbnail image for an attachment.
@MainActor
@available(visionOS, unavailable)
struct ThumbnailView: View {
/// The model represented by the thumbnail.
@ObservedObject var attachmentModel: AttachmentModel
Expand Down
3 changes: 3 additions & 0 deletions Sources/ArcGISToolkit/Components/Compass/Compass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import SwiftUI
/// in the project. To learn more about using the `Compass` see the <doc:CompassTutorial>.
@MainActor
@preconcurrency
@available(visionOS, unavailable)
public struct Compass: View {
/// The opacity of the compass.
@State private var opacity: Double = .zero
Expand Down Expand Up @@ -115,6 +116,7 @@ public struct Compass: View {
}
}

@available(visionOS, unavailable)
extension Compass {
/// Returns a Boolean value indicating whether the compass should hide based on the
/// provided heading and whether the compass has been configured to automatically hide.
Expand All @@ -125,6 +127,7 @@ extension Compass {
}
}

@available(visionOS, unavailable)
public extension Compass {
/// Creates a compass with a rotation (0° indicates a direction toward true North, 90° indicates
/// a direction toward true West, etc.).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ internal import os

/// The context menu shown when the new attachment button is pressed.
@MainActor
@available(visionOS, unavailable)
struct AttachmentImportMenu: View {
/// The attachment form element displaying the menu.
private let element: AttachmentsFormElement
Expand Down Expand Up @@ -229,6 +230,7 @@ struct AttachmentImportMenu: View {
}
}

@available(visionOS, unavailable)
private extension AttachmentImportMenu {
/// A button that redirects the user to the application's entry in the iOS system Settings application.
var appSettingsButton: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import SwiftUI

@available(visionOS, unavailable)
public extension FeatureFormView {
/// The validation error visibility configuration of a form.
enum ValidationErrorVisibility: Sendable {
Expand All @@ -30,6 +31,7 @@ public extension FeatureFormView {
}
}

@available(visionOS, unavailable)
extension EnvironmentValues {
/// The validation error visibility configuration of a form.
var validationErrorVisibility: FeatureFormView.ValidationErrorVisibility {
Expand All @@ -39,6 +41,7 @@ extension EnvironmentValues {
}

/// The validation error visibility configuration of a form.
@available(visionOS, unavailable)
private struct FormViewValidationErrorVisibility: EnvironmentKey {
static let defaultValue: FeatureFormView.ValidationErrorVisibility = .automatic
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import SwiftUI
/// - Since: 200.4
@MainActor
@preconcurrency
@available(visionOS, unavailable)
public struct FeatureFormView: View {
/// The view model for the form.
@StateObject private var model: FormViewModel
Expand Down Expand Up @@ -128,6 +129,7 @@ public struct FeatureFormView: View {
}
}

@available(visionOS, unavailable)
extension FeatureFormView {
/// Makes UI for a form element.
/// - Parameter element: The element to generate UI for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import SwiftUI

/// A view shown at the bottom of a field element in a form.
@MainActor
@available(visionOS, unavailable)
struct InputFooter: View {
@Environment(\.formElementPadding) var elementPadding

Expand Down Expand Up @@ -74,6 +75,7 @@ struct InputFooter: View {
}
}

@available(visionOS, unavailable)
extension InputFooter {
/// Localized error text to be shown to a user depending on the type of error information available.
var errorMessage: Text? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import SwiftUI
///
/// This view injects a header and footer. It also monitors whether a field form element is editable and
/// chooses the correct input view based on the input type.
@available(visionOS, unavailable)
struct InputWrapper: View {
/// A Boolean value indicating whether the input is editable.
@State private var isEditable = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import SwiftUI

/// A view for text input.
@MainActor
@available(visionOS, unavailable)
struct TextInput: View {
/// The view model for the form.
@EnvironmentObject var model: FormViewModel
Expand Down Expand Up @@ -75,6 +76,7 @@ struct TextInput: View {
}
}

@available(visionOS, unavailable)
private extension TextInput {
/// The body of the text input when the element is editable.
var textWriter: some View {
Expand Down Expand Up @@ -167,6 +169,7 @@ private extension TextInput {
}
}

@available(visionOS, unavailable)
private extension TextInput {
/// A view for displaying a multiline text input outside the body of the feature form view.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import SwiftUI
/// in the project. To learn more about using the `FloorFilter` see the <doc:FloorFilterTutorial>.
@MainActor
@preconcurrency
@available(visionOS, unavailable)
public struct FloorFilter: View {
@Environment(\.horizontalSizeClass)
private var horizontalSizeClass: UserInterfaceSizeClass?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

/// Defines automatic selection behavior.
@available(visionOS, unavailable)
public enum FloorFilterAutomaticSelectionMode: Sendable {
/// Always update selection based on the current viewpoint; clear the selection when the user
/// navigates away.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import ArcGIS

/// A selected site, facility, or level.
@available(visionOS, unavailable)
public enum FloorFilterSelection: Hashable, Sendable {
/// A selected site.
case site(FloorSite)
Expand All @@ -24,6 +25,7 @@ public enum FloorFilterSelection: Hashable, Sendable {
case level(FloorLevel)
}

@available(visionOS, unavailable)
public extension FloorFilterSelection {
/// The selected site.
var site: FloorSite? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import SwiftUI

/// Manages the state for a `FloorFilter`.
@MainActor
@available(visionOS, unavailable)
final class FloorFilterViewModel: ObservableObject {
/// Creates a `FloorFilterViewModel`.
/// - Parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import ArcGIS

/// A view which allows selection of levels represented in `FloorFacility`.
@MainActor
@available(visionOS, unavailable)
struct LevelSelector: View {
/// The view model used by the `LevelsView`.
@EnvironmentObject var viewModel: FloorFilterViewModel
Expand Down Expand Up @@ -50,6 +51,7 @@ struct LevelSelector: View {
}
}

@available(visionOS, unavailable)
extension LevelSelector {
/// A list of all the levels to be displayed.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import SwiftUI
///
/// If the floor aware data contains only one site, the selector opens directly to the facilities list.
@MainActor
@available(visionOS, unavailable)
struct SiteAndFacilitySelector: View {
/// Allows the user to toggle the visibility of the site and facility selector.
@Binding var isPresented: Bool
Expand Down Expand Up @@ -214,6 +215,7 @@ struct SiteAndFacilitySelector: View {
}
}

@available(visionOS, unavailable)
extension SiteAndFacilitySelector {
/// A Boolean value indicating whether the back button in the header navigations controls is visible..
var backButtonIsVisible: Bool {
Expand Down
2 changes: 2 additions & 0 deletions Sources/ArcGISToolkit/Components/JobManager/JobManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ internal import os
/// In UIKit it would be the `UIApplicationDelegate` method `func application(UIApplication, handleEventsForBackgroundURLSession: String, completionHandler: () -> Void)`
/// - Since: 200.3
@MainActor
@available(visionOS, unavailable)
public class JobManager: ObservableObject {
/// The shared job manager.
public static let `shared` = JobManager()
Expand Down Expand Up @@ -287,6 +288,7 @@ public class JobManager: ObservableObject {
}

/// An enum that defines a schedule for background status checks.
@available(visionOS, unavailable)
public enum BackgroundStatusCheckSchedule: Sendable {
/// No background status checks will be requested.
case disabled
Expand Down
2 changes: 2 additions & 0 deletions Sources/ArcGISToolkit/Components/OverviewMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import SwiftUI
/// in the project. To learn more about using the `OverviewMap` see the <doc:OverviewMapTutorial>.
@MainActor
@preconcurrency
@available(visionOS, unavailable)
public struct OverviewMap: View {
/// The `Viewpoint` of the main `GeoView`.
let viewpoint: Viewpoint?
Expand Down Expand Up @@ -213,6 +214,7 @@ private extension Symbol {
}
}

@available(visionOS, unavailable)
private extension OverviewMap {
@MainActor
private class DataModel: ObservableObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import SwiftUI
import ArcGIS

/// A view displaying a `MediaPopupElement`.
@available(visionOS, unavailable)
struct MediaPopupElementView: View {
/// The `PopupElement` to display.
var popupElement: MediaPopupElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import SwiftUI
import ArcGIS

/// A view displaying chart popup media.
@available(visionOS, unavailable)
struct ChartMediaView: View {
/// The popup media to display.
let popupMedia: PopupMedia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import SwiftUI
import ArcGIS

/// A view displaying image popup media.
@available(visionOS, unavailable)
struct ImageMediaView: View {
/// The popup media to display.
let popupMedia: PopupMedia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import SwiftUI
import ArcGIS

/// A view displaying a popup media in a large format.
@available(visionOS, unavailable)
struct MediaDetailView : View {
/// The popup media to display.
let popupMedia: PopupMedia
Expand Down
4 changes: 4 additions & 0 deletions Sources/ArcGISToolkit/Components/Popups/PopupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import ArcGIS
/// in the project. To learn more about using the `PopupView` see the <doc:PopupViewTutorial>.
@MainActor
@preconcurrency
@available(visionOS, unavailable)
public struct PopupView: View {
/// Creates a `PopupView` with the given popup.
/// - Parameters:
Expand Down Expand Up @@ -156,6 +157,7 @@ public struct PopupView: View {
}
}

@available(visionOS, unavailable)
extension PopupView {
private struct PopupElementList: View {
let popupElements: [PopupElement]
Expand Down Expand Up @@ -183,6 +185,7 @@ extension PopupView {
}
}

@available(visionOS, unavailable)
extension PopupView {
/// An object used to hold the result of evaluating the expressions of a popup.
private final class Evaluation {
Expand All @@ -202,6 +205,7 @@ extension PopupView {
}
}

@available(visionOS, unavailable)
extension PopupView {
/// Specifies whether a "close" button should be shown to the right of the popup title. If the "close"
/// button is shown, you should pass in the `isPresented` argument to the `PopupView`
Expand Down
Loading