Skip to content

Commit

Permalink
Fix crash on favorites reorder when run on iOS 18
Browse files Browse the repository at this point in the history
  • Loading branch information
dus7 committed Nov 14, 2024
1 parent 8739310 commit 01f3721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DuckDuckGo/FavoritesHomeViewSectionRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class FavoritesHomeViewSectionRenderer {
let dragItem = coordinator.items.first?.dragItem,
let sourcePath = coordinator.items.first?.sourceIndexPath,
let destinationPath = coordinator.destinationIndexPath,
let cell = self.collectionView(collectionView, cellForItemAt: sourcePath) as? FavoriteHomeCell,
let cell = collectionView.cellForItem(at: sourcePath) as? FavoriteHomeCell,
let favorite = cell.favorite
else { return }

Expand All @@ -288,7 +288,7 @@ class FavoritesHomeViewSectionRenderer {
}

func collectionView(_ collectionView: UICollectionView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
guard let cell = self.collectionView(collectionView, cellForItemAt: indexPath) as? FavoriteHomeCell else { return [] }
guard let cell = collectionView.cellForItem(at: indexPath) as? FavoriteHomeCell else { return [] }

if let size = cell.iconImage.image?.size.width, size <= 32 {
cell.iconBackground.backgroundColor = ThemeManager.shared.currentTheme.backgroundColor
Expand Down

0 comments on commit 01f3721

Please sign in to comment.