nalexn / ViewInspector

Runtime introspection and unit testing of SwiftUI views
MIT License
2.09k stars 145 forks source link

Ported iOS16 ToggleState enum fix from SoundCloud/Axt to ViewInspector #293

Closed sureshjoshi closed 4 months ago

sureshjoshi commented 5 months ago

Closes #230

Uses the solution discovered here to handle the new SwiftUI.ToggleState (instead of Bool) problem: https://github.com/soundcloud/Axt/blob/master/Sources/Axt/Native/Toggle.swift

Essentially, for iOS16+, we use a new ToggleState enum and do some unsafe pointer shenanigans to map the local enum to the SwiftUI internals enum.

Removed the forced skips from the two remaining toggle.

There could be an outstanding question of how we should handle .mixed - but I treat it as a false in this PR.

nalexn commented 4 months ago

That's great, thank you for the PR! This should help many people