Skip to content

Commit

Permalink
Two bits of cleanup In UIViewLazyList (#1659)
Browse files Browse the repository at this point in the history
- Removing call to set contentView.translatesAutoresizingMaskIntoConstraints to false, because this is not supported by iOS, and yields the following warning:

"Changing the translatesAutoresizingMaskIntoConstraints property of the contentView of a UITableViewCell is not supported and will result in undefined behavior, as this property is managed by the owning UITableViewCell"

- Adding call to removeAllSubviews within prepareForReuse
  • Loading branch information
dnagler authored Oct 31, 2023
1 parent 51ece61 commit 9ad8353
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ internal class LazyListContainerCell(
removeAllSubviews()
if (value != null) {
contentView.addSubview(value.value)
contentView.translatesAutoresizingMaskIntoConstraints = false
}
setNeedsLayout()
}
Expand Down Expand Up @@ -273,6 +272,7 @@ internal class LazyListContainerCell(

override fun prepareForReuse() {
super.prepareForReuse()
removeAllSubviews()
binding?.unbind()
binding = null
}
Expand Down

0 comments on commit 9ad8353

Please sign in to comment.