Skip to content

0.0.1

Choose a tag to compare

@mgdgc mgdgc released this 26 May 06:05
· 4 commits to main since this release

Usage

Viewrito {
    TextField("", text: $text)
} returning: { textField in
    if #available(iOS 17, *) {
        textField
            .onChange(of: text) { old, new in
                print("\(old) -> \(new)")
            }
    } else {
        textField
            .onChange(of: text) { new in
                print("\(new)")
            }
    }
}

or

TextField("", text: $text)
    .addViewModifier {
        if #available(iOS 17, *) {
            $0.onChange(of: text) { old, new in
                print("\(old) -> \(new)")
            }
        }
    }