Using the iOS Integration (beta)
Get your iOS accessibility results into the Stark dashboard
With Stark's iOS integration, you can unlock deeper accessibility scans and get youre results to show up in the Stark dashboard alongside your other assets.
Using the iOS Integration
Requirements
- iOS 17.0+ / macOS 14.0+
- Swift 6.0+
- Xcode 16.0+
Installation with Swift Package Manager
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
Usage
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")
}
}
Suppressing Test Failures
If you want to collect and report accessibility issues but not fail the test:
try checker.auditScreen(
application: app,
scanName: "HomeScreen",
failTestOnAccessibilityIssues: false
)
Bringing scan results into Stark
- Log into your Stark account
- Click
Create a Project
- Scroll to
Add iOS app
and follow the instructions shown - Provide a
Name
for easy reference when viewing all of your assets - Run the integration in iOS to see your results show up in Stark
Using the iOS SwiftLint Tool
A specialized SwiftLint tool that checks your iOS projects for accessibility compliance and automatically reports results to the Stark platform. Download the tool and learn about the numerous options it has for running it and sending results back to Stark.
Have any questions about using Stark's developer tools? Don’t hesitate to reach out to us at support@getstark.co.