Support

How can we help you?

Get answers to all your Stark-related questions with
step-by-step guides from our Support center.

Using the iOS Integration

Get your iOS accessibility results into the Stark dashboard


Quick-start with an AI prompt

Copy this into your AI coding agent of choice to get set up without having to work through the steps below by hand.

Set up Stark's iOS accessibility integration in this Xcode project.

Facts to use as-is (don't guess at the API or invent parameters):
- Requirements: iOS 17.0+ / macOS 14.0+, Swift 6.0+, Xcode 16.0+. Check the project's
  deployment target before doing anything — if it's below iOS 17, stop and tell me.
- Swift Package Manager dependency:
      .package(url: "https://github.com/stark-contrast/stark-ios.git", from: "0.0.1")
  Module to import: `StarkAccessibilityIOS`.
- API, used inside a UI test:
      let checker = AccessibilityChecker(starkProjectToken: "<token>")
      try checker.auditScreen(application: app, scanName: "HomeScreen")
- `auditScreen` audits whatever is on screen at the moment it's called, so the test has
  to navigate to the target screen first.
- Passing `failTestOnAccessibilityIssues: false` collects and reports issues without
  failing the test.
- My Stark project token: PASTE_YOUR_TOKEN_HERE
  (from app.getstark.co → Create a Project → Add iOS app)

Steps:
1. Report the project's structure before changing anything: deployment target, whether
   it uses a `Package.swift` or an `.xcodeproj`/`.xcworkspace`, and — importantly —
   whether a UI Testing target already exists.
2. This code must live in a UI Testing bundle, not a unit test target. `XCUIApplication`
   won't drive the app from a unit test. If there's no UI test target, tell me and stop;
   don't add the audit to whatever test target happens to exist.
3. Add the package dependency, and make sure the UI test target actually links the
   `StarkAccessibilityIOS` product — adding the package alone isn't enough.
4. List the screens this UI test suite already navigates to. Propose which ones to audit
   and a stable `scanName` for each, and wait for me before writing tests.
5. Read the token from the test scheme's environment via
   `ProcessInfo.processInfo.environment` rather than hardcoding it in a test file that
   gets committed. Confirm where you're putting it.
6. Write the audits with `failTestOnAccessibilityIssues: false` for the first run, so I
   can see the full picture before anything starts failing CI. Show me the diff and stop.

Once I've reviewed:
7. Run the UI tests and summarize what each screen reported.
8. Tell me which screens are clean enough to flip to failing (drop the
   `failTestOnAccessibilityIssues: false`), and propose the CI wiring with the token as
   a secret injected into the scheme environment.

Constraints: use only the parameters shown above, don't invent additional
AccessibilityChecker options, and if the build or test fails show me the real Xcode
error before proposing a fix.

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

📝
Each report is categorized based on the WCAG success criteria to make comparisons to other assets even simpler.

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:

// Package.swift
dependencies: [
    .package(url: "https://github.com/stark-contrast/stark-ios.git", .upToNextMinor(from: "0.0.1"))
],
targets: [
    .testTarget(
        name: "MyAppUITests",
        dependencies: [
            .product(name: "StarkAccessibilityIOS", package: "stark-ios")
        ]
    )
]

Or add it directly in Xcode:

  1. File > Add Package Dependencies
  2. Enter the repository URL: https://github.com/stark-contrast/stark-ios.git
  3. When prompted, add StarkAccessibilityIOS to your UI Testing target, not your app target

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

  1. Log into your Stark account
  2. Click Create a Project
  3. Scroll to Add iOS app 
  4. Copy the Stark token shown into the starkToken field mentioned above
  5. Provide a Name for easy reference when viewing all of your assets
  6. 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.

Go back to articles