Skip to content

1.1.0

Latest

Choose a tag to compare

@nikolamajcen nikolamajcen released this 05 Nov 12:26
· 88 commits to main since this release
e191838

AccessibilityKit 1.1.0 lets you correct accessibility values before they're reported, makes AccessibilityType enumerable, and fixes several observation bugs. It also adds a test suite and documents the whole public API in DocC.

📝 Upgrade notes

  • CocoaPods is no longer supported. Install the package with Swift Package Manager.
  • Snapshot states are now always sorted. The docs always said they were, but snapshots from currentAccessibilitySnapshot(for:) and from observation came back in configuration order. Sorting also changes the order of the values array in the encoded JSON. If you read states by position, look them up by identifier or type instead. (#8)
  • The font scale feature's name is now "Font Scale" (it was "Font scale"). Its identifier is unchanged, so encoded payloads stay the same. (#11)
  • Requirements: iOS 14, Xcode 15. The README used to say Xcode 12, but the package needed Swift 5.9 even at 1.0.0. (#20)

✨ New

  • Correct values at the source. AccessibilityTrackingObject takes an optional transform that corrects the value where it's produced, so the encoded output carries the corrected value too. Put the object in your tracking configuration and the correction also reaches observed changes and the monitor (#9, closes #5):
    AccessibilityTrackingObject(
        type: .fontScale,
        customIdentifier: "large_text_enabled",
        transform: { value in .flag((value.scaleValue ?? 1) >= 1.2) }
    )
  • AccessibilityState.withValue(_:) returns a copy with a different value, and AccessibilitySnapshot.init(states:) is now public, so you can correct a snapshot after the fact. (#9)
  • AccessibilityType conforms to CaseIterable, so you can track every feature with AccessibilityType.allCases. If you declared this conformance yourself, remove it to avoid a duplicate-conformance warning. (#12)
  • AccessibilityValue is Sendable. (#9)

🐛 Fixes

  • Reconfiguring tracking no longer silently stops an existing observation. (#11)
  • After reconfiguring, a snapshot taken under the old configuration is no longer delivered. (#11)
  • An observer added twice is now notified once per change. (#11)
  • Snapshots are no longer kept in memory for the life of the process. (#11)
  • The monitor no longer retains its observers in a cycle. (#10)
  • AccessibilityMonitorView keeps one view model while it's shown. Embedded in SwiftUI (for example in a .sheet), it used to re-register its observation and flash an empty list on every parent re-render. (#21)
  • The example app now resolves the package from its own repository, whatever the clone's folder is called. (#9)

📚 Docs and tests

  • Every public symbol has DocC documentation. The README now matches the library, including the real JSON output. (#13)
  • The package has its first tests: 50 in 9 suites, covering the public API and the observation internals. (#8, #10, #11, #12)

Known limitation

Presenting the accessibility monitor replaces the app's own observeAccessibilityTracking completion while it's open. The README and DocC describe this. A fix depends on the Swift 6 work and is planned for the next major release.

What's Changed

Full Changelog: 1.0.0...1.1.0