| name | usage |
| description | Explains how to integrate and use the DeclarationAccessibility SwiftUI library (StatementView) in an iOS/iPadOS app, including local/remote detail pages, webview vs browser display, themes, and OUDS integration. Use this when a developer asks how to add, configure, or display an accessibility statement view in a Swift/SwiftUI app. |
| license | Apache-2.0 |
| compatibility | opencode |
| metadata | {"language":"swift","ui-framework":"swiftui","platforms":"ios, ipados"} |
Using the Accessibility Statement Library (DeclarationAccessibility)
This skill explains how to integrate the DeclarationAccessibility Swift Package into an iOS/iPadOS SwiftUI app to display an accessibility statement generated by La va11ydette.
Import the library
import DeclarationAccessibility
The package must be added as a Swift Package dependency (see Package.swift of this repo for the package name/URL).
Core concept
The library exposes a single SwiftUI view, StatementView, which:
- Parses an XML file (generated by La va11ydette) describing the compliance statement and scores.
- Optionally links to a detailed HTML page, which can be local (bundled) or remote, and displayed in a webview or opened in the system browser.
- Supports theming (
orange, sosh, innovationCup) or a custom OUDSTheme if using the OUDS library.
Basic setup (local HTML detail page)
import DeclarationAccessibility
import SwiftUI
struct AccessibilityStatementView: View {
let detailsPageURL: URL
init() {
guard let detailsPageURL = Bundle.main.url(forResource: "accessibility_detail", withExtension: "html") else {
fatalError("Unable to find accessibility_detail.html in resources")
}
self.detailsPageURL = detailsPageURL
}
var body: some View {
VStack {
StatementView(xmlFileName: "accessibility_result", theme: .orange, localURL: detailsPageURL.absoluteString)
}
}
}
Requirements:
accessibility_result.xml must be included as a resource in the app bundle (root XML from La va11ydette).
accessibility_detail.html (optional) must also be bundled if used for local details.
Using a remote/external detail page
StatementView(xmlFile: "accessibility_result", theme: .orange, remoteUrl: "https://a11y-guidelines.orange.com/fr/", useWebView: true)
StatementView(xmlFile: "accessibility_result", theme: .orange, remoteUrl: "https://a11y-guidelines.orange.com/fr/")
Using the Orange Unified Design System (OUDS)
If the app already depends on OUDS iOS, pass an OUDSTheme object instead of the built-in theme enum to inherit the app's design system automatically:
import DeclarationAccessibility
import OUDSSwiftUI
import SwiftUI
struct AccessibilityStatementPage: View {
let detailsPageURL: URL
@Environment(\.theme) var theme
init() {
guard let detailsPageURL = Bundle.main.url(forResource: "accessibility_detail", withExtension: "html") else {
OL.fatal("Unable to find accessibility_detail.html in resources")
}
self.detailsPageURL = detailsPageURL
}
var body: some View {
VStack {
StatementView(xmlFile: "accessibility_result", localUrl: detailsPageURL.absoluteString, theme: theme)
}
}
}
This also works with a remote URL:
StatementView(xmlFile: "accessibility_result", remoteUrl: "https://a11y-guidelines.orange.com/fr/", useWebView: true, theme: someOudsTheme)
Decision guide
| Need | Parameter to use |
|---|
| XML statement file bundled in the app | xmlFile / xmlFileName (file name without extension, in app bundle) |
| Detail page bundled locally | localUrl / localURL (absolute string URL to the local HTML file) |
| Detail page hosted externally | remoteUrl (absolute URL string) |
| Show remote detail page inside the app | useWebView: true |
| Open remote detail page in system browser | useWebView: false or omit it |
| Built-in theme | theme: .orange, .sosh, or .innovationCup |
| App-wide OUDS theme | theme: someOudsTheme (an OUDSTheme instance) |
Notes and constraints
- Minimum deployment target: iOS 15.0 / iPadOS 15.0.
- The XML file must be generated by La va11ydette to match the expected schema.
- Do not mix
localUrl and remoteUrl on the same StatementView call — choose one detail source.
- See the repository
README.md and MIGRATION.md for version-specific API changes.