Skip to content

Commit

Permalink
Merge pull request #327 from lukeredpath/patch-1
Browse files Browse the repository at this point in the history
Fix unowned reference that can cause crash
  • Loading branch information
JanGorman authored Jul 31, 2022
2 parents dac5b02 + 1029140 commit 82eaa5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Agrume/AgrumeCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ extension AgrumeCell: UIGestureRecognizerDelegate {
contentView.isUserInteractionEnabled = false

CATransaction.begin()
CATransaction.setCompletionBlock { [unowned self] in
CATransaction.setCompletionBlock { [weak self] in
// captures self weakly to avoid extending the lifetime of the cell
guard let self = self else { return }
self.contentView.isUserInteractionEnabled = true
}
scrollView.zoom(to: destination, animated: true)
Expand Down

0 comments on commit 82eaa5a

Please sign in to comment.