Skip to content

Commit

Permalink
Revert "Revert "Force layout before appear, to avoid animated updates (
Browse files Browse the repository at this point in the history
…#505)""

This reverts commit 989bf10.
  • Loading branch information
kyleve committed Dec 8, 2023
1 parent 5d989dc commit d11bb07
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Fixed

- Fixed an issue where animations would occur when dequeuing / reusing cells. A layout is now forced without animation before presentation.

### Added

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,15 @@ extension PresentationState
HeaderFooterContentView<Content>(frame: frame)
}

self.applyTo(
view: view,
for: .willDisplay,
with: .init(environment: environment)
)
UIView.performWithoutAnimation {
self.applyTo(
view: view,
for: .willDisplay,
with: .init(environment: environment)
)

view.layoutIfNeeded()
}

return view
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,16 @@ extension PresentationState

let itemState = ListableUI.ItemState(cell: cell, isReordering: false)

self.applyTo(
cell: cell,
itemState: itemState,
reason: .willDisplay,
environment: environment
)
UIView.performWithoutAnimation {
self.applyTo(
cell: cell,
itemState: itemState,
reason: .willDisplay,
environment: environment
)

cell.layoutIfNeeded()
}

return cell
}
Expand Down

0 comments on commit d11bb07

Please sign in to comment.