Skip to content

Commit

Permalink
Merge pull request #167 from tumblr/Fix-iOS18-CellDequeue-Crash
Browse files Browse the repository at this point in the history
Fix iOS 18 cell dequeue crash
  • Loading branch information
benjamin-su authored Oct 24, 2024
2 parents b6f6e3b + 0e8289b commit f0c5515
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Classes/Editor/EditorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,10 @@ public final class EditorViewController: UIViewController, MediaPlayerController
// MARK: - GIF Maker Helpers

private func openGIFMaker(animated: Bool) {
guard let cell = collectionController.getCell(for: .gif) else {
assertionFailure("Failed to open GIF Maker")
return
}
openGIFMaker(cell: cell, animated: animated, permanent: true)
openGIFMaker(cell: collectionController.getCell(for: .gif), animated: animated, permanent: true)
}

private func openGIFMaker(cell: KanvasEditorMenuCollectionCell, animated: Bool, permanent: Bool) {
private func openGIFMaker(cell: KanvasEditorMenuCollectionCell?, animated: Bool, permanent: Bool) {
let editionOption = EditionOption.gif
onBeforeShowingEditionMenu(editionOption, cell: cell)
showMainUI(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ final class EditionMenuCollectionController: UIViewController, KanvasEditorMenuC
return nil
}
let indexPath = IndexPath(item: index, section: Constants.section)
return self.collectionView(collectionView, cellForItemAt: indexPath) as? EditionMenuCollectionCell
return collectionView.cellForItem(at: indexPath) as? EditionMenuCollectionCell
}

// MARK: - UICollectionViewDataSource
Expand Down

0 comments on commit f0c5515

Please sign in to comment.