Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To disable textfield for edit mode on iOS13 #1

Open
LukaszDziwosz opened this issue Nov 30, 2021 · 0 comments
Open

To disable textfield for edit mode on iOS13 #1

LukaszDziwosz opened this issue Nov 30, 2021 · 0 comments

Comments

@LukaszDziwosz
Copy link

As we can't use .onChange on iOS 13 here is solution with .onReceive: .

onReceive(Just(editMode?.wrappedValue)) { newValue in
                        if (newValue != nil) && (newValue!.isEditing) {
                            disableTextField = false // Edit button tapped
                            } else {
                            disableTextField = true // Done button tapped
                            }
                    }

You just have to import Combine, works the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant