Skip to content

Commit

Permalink
Update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bryankeller committed Aug 6, 2024
1 parent 54ba997 commit 98f5fbf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Rewrote accessibility code to avoid posting notifications, which causes poor Voice Over performance and odd focus bugs
- Rewrote `ItemViewReuseManager` to perform fewer set operations, improving CPU usage by ~15% when scrolling quickly on an iPhone XR

## [v2.0.0](https://github.com/airbnb/HorizonCalendar/compare/v1.16.0...v2.0.0) - 2023-12-19

Expand Down
39 changes: 20 additions & 19 deletions Sources/Internal/ItemViewReuseManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,26 @@ final class ItemViewReuseManager {
let viewDifferentiator = visibleItem.calendarItemModel._itemViewDifferentiator

let context: ReusedViewContext =
if let view = previousViewsForVisibleItems.removeValue(forKey: visibleItem) {
ReusedViewContext(
view: view,
visibleItem: visibleItem,
isViewReused: true,
isReusedViewSameAsPreviousView: true)
} else if !(unusedViewsForViewDifferentiators[viewDifferentiator]?.isEmpty ?? true) {
ReusedViewContext(
view: unusedViewsForViewDifferentiators[viewDifferentiator]!.remove(at: 0),
visibleItem: visibleItem,
isViewReused: true,
isReusedViewSameAsPreviousView: false)
} else {
ReusedViewContext(
view: ItemView(initialCalendarItemModel: visibleItem.calendarItemModel),
visibleItem: visibleItem,
isViewReused: false,
isReusedViewSameAsPreviousView: false)
}
if let view = previousViewsForVisibleItems.removeValue(forKey: visibleItem)
{
ReusedViewContext(
view: view,
visibleItem: visibleItem,
isViewReused: true,
isReusedViewSameAsPreviousView: true)
} else if !(unusedViewsForViewDifferentiators[viewDifferentiator]?.isEmpty ?? true) {
ReusedViewContext(
view: unusedViewsForViewDifferentiators[viewDifferentiator]!.remove(at: 0),
visibleItem: visibleItem,
isViewReused: true,
isReusedViewSameAsPreviousView: false)
} else {
ReusedViewContext(
view: ItemView(initialCalendarItemModel: visibleItem.calendarItemModel),
visibleItem: visibleItem,
isViewReused: false,
isReusedViewSameAsPreviousView: false)
}

contexts.append(context)

Expand Down

0 comments on commit 98f5fbf

Please sign in to comment.