-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
onCellUnHighlight doesn't get called unless onCellHighlight is also defined #96
Comments
@jefflai Actually this is not an issue. This is how onCellHighlight and onCellUnHighlight work by default. Your custom public final class TextRow: _TextRow, RowType {
required public init(tag: String?) {
super.init(tag: tag)
onCellHighlight { cell, row in
let color = cell.textLabel?.textColor
row.onCellUnHighlight { cell, _ in
cell.textLabel?.textColor = color
}
cell.textLabel?.textColor = cell.tintColor
}
}
} The reason we override by default the So in order to avoid this you must set up a Regards |
@mtnbarreto ok that makes sense. perhaps the ReadMe should be updated to explain this |
@jefflai done |
Thanks! @mtnbarreto |
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.
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
The text was updated successfully, but these errors were encountered: