Deviopath › Swift

Toggle Binding

Hard · SwiftUI

A binding is a get/set pair. runToggle(flags, index) flips flags[index] if in range and returns the new array. Out of range leaves it unchanged.

Write runToggle(_:_:).

Next: Cooperative Cancel