A Swift package for performing accessibility audits in iOS applications.
- iOS 17.0+ / macOS 14.0+
- Swift 6.0+
- Xcode 16.0+
Add the following dependency to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/stark-contrast/stark-ios.git", from: "0.0.1")
]
Or add it directly in Xcode:
- File > Swift Packages > Add Package Dependency
- Enter the repository URL:
https://github.com/stark-contrast/stark-ios.git
import XCTest
import StarkAccessibilityIOS
class MyUITests: XCTestCase {
func testAccessibility() throws {
let app = XCUIApplication()
app.launch()
// Navigate to the screen you want to test
app.tabBars.buttons["Home"].tap()
// Create a checker and audit the screen
let checker = AccessibilityChecker(starkProjectToken: "your-stark-project-token")
try checker.auditScreen(application: app, scanName: "HomeScreen")
}
}
If you want to collect and report accessibility issues but not fail the test:
try checker.auditScreen(
application: app,
scanName: "HomeScreen",
failTestOnAccessibilityIssues: false
)
This project is licensed under a custom license - see the LICENSE file included in this repository for details.