Instance Method インスタンスメソッド

accessibilityScrollAction(_:)

Adds an accessibility scroll action to the view. アクセシビリティスクロールアクションをこのビューに加えます。 Actions allow assistive technologies, such as the VoiceOver, to interact with the view by invoking the action.

Declaration 宣言

func accessibilityScrollAction(_ handler: @escaping (Edge) -> Void) -> ModifiedContent<Self, AccessibilityAttachmentModifier>

Discussion 議論

For example, this is how a scroll action to trigger a refresh could be added to a view.


var body: some View {
    ScrollView {
        ContentView()
    }
    .accessibilityScrollAction { edge in
        if edge == .top {
            // Refresh content
        }
    }
}