Skip to content

Commit

Permalink
Stop clearing the text color for unknown answers.
Browse files Browse the repository at this point in the history
  • Loading branch information
twostraws committed May 6, 2019
1 parent 0e16929 commit f304130
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Unwrap/Extensions/UITableViewCell-Styling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ extension UITableViewCell {
func unknownAnswer() {
backgroundColor = .white
multipleSelectionBackgroundView?.backgroundColor = backgroundColor
textLabel?.textColor = .black
tintColor = nil
}
}

2 comments on commit f304130

@machl
Copy link

@machl machl commented on f304130 May 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twostraws This causes issue when the cell is reused - the textColor might remain white on white background. See screenhots below.

What was the reason for this change?

IMG_1217
IMG_1218

@twostraws
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been resolved now, and the fix will be in the next update – see my lengthy comment on

// We need to start off every label with black text, even though it will be using an attributed string for its exact styling. Without this next line of code, cell re-use will cause a problem in questions without syntax highlighting: correct/wrong answers will have their text color set to white, and cell re-use will cause that to be propagated to cells with a white background color. While we could update unknownAnswer() to set a black text color, doing so would strip syntax highlighting from questions that have it enabled, so the best solution is to start with a black and let syntax highlighting / white color override as necessary.
for details.

Please sign in to comment.