fix label and people selection states (#1995)

This commit is contained in:
Ryan Nystrom
2018-07-28 17:04:50 -04:00
committed by GitHub
parent f02831d654
commit ee7b37bb86
2 changed files with 8 additions and 4 deletions

View File

@@ -28,13 +28,13 @@ final class LabelSectionController: ListSwiftSectionController<RepositoryLabel>
height: Styles.Sizes.tableCellHeightLarge
)
},
configure: { [selected] in
configure: { [weak self] in
let color = $1.value.color.color
$0.button.setTitleColor(color.textOverlayColor, for: .normal)
$0.button.backgroundColor = color
$0.button.setTitle($1.value.name, for: .normal)
$0.setSelected(selected)
$0.setSelected(self?.selected == true)
},
didSelect: { [weak self] context in
guard let strongSelf = self else { return }

View File

@@ -34,8 +34,12 @@ final class PeopleSectionController: ListSwiftSectionController<IssueAssigneeVie
height: Styles.Sizes.tableCellHeightLarge
)
},
configure: { [selected] in
$0.configure(avatarURL: $1.value.avatarURL, username: $1.value.login, showCheckmark: selected)
configure: { [weak self] in
$0.configure(
avatarURL: $1.value.avatarURL,
username: $1.value.login,
showCheckmark: self?.selected == true
)
},
didSelect: { [weak self] context in
guard let strongSelf = self else { return }