Skip to content

Commit

Permalink
Perform emoji selection on main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisbronchart authored Oct 15, 2024
1 parent 71d2d46 commit 95db590
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/ElegantEmojiPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ extension ElegantEmojiPicker: UICollectionViewDelegate, UICollectionViewDataSour
}

public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let selection = searchResults?[indexPath.row] ?? emojiSections[indexPath.section].emojis[indexPath.row]
didSelectEmoji(selection)
DispatchQueue.main.async {
let selection = searchResults?[indexPath.row] ?? emojiSections[indexPath.section].emojis[indexPath.row]
didSelectEmoji(selection)
}
}

public func scrollViewDidScroll(_ scrollView: UIScrollView) {
Expand Down

0 comments on commit 95db590

Please sign in to comment.