Skip to content

onCellUnHighlight doesn't get called unless onCellHighlight is also defined #96

@jefflai

Description

@jefflai

The onCellUnHighlight function for a Row doesn't get called if the onCellHighlight function is not also specified for the Row. This is confusing because the documentation doesn't state that both of these functions have to be defined for onCellUnHighlight to work.

This is the debug code I used to find this bug.

form +++ Section("Debug")
            <<< TextRow("debugTextRow1") {
                    $0.title = "Debug Text Row 1"
                }.onCellHighlight { cell, row in
                    print("text onCellHighlight 1")
                }.onCellUnHighlight{ cell, row in
                    print("text onCellUnHighlight 1")
                }
            <<< TextRow("debugTextRow2") {
                    $0.title = "Debug Text Row 2"
                }.onCellUnHighlight{ cell, row in
                    print("text onCellUnHighlight 2")
                }

Tapping on debugTextRow1 and then tapping outside debugTextRow1 to trigger onCellUnHighlight works as expected with both onCellHighlight and onCellUnHighlight defined.

However, doing the same steps with debugTextRow2 doesn't work as expected. The onCellUnHighlight function for debugTextRow2 is never called.

I'm using XCode 7.1.1 and the project has a deployment target of iOS 9.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions