Skip to content

To disable textfield for edit mode on iOS13 #1

@LukaszDziwosz

Description

@LukaszDziwosz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions