Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions TF1Sample/ReactionBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,25 @@ class ReactionViewController: UIViewController {
}

private func fetchReactionPacks(reactionPackIDs: [String]) {
let group = DispatchGroup()
for packID in reactionPackIDs {
self.sdk.reaction.getReactionPackInfo(reactionPackID: packID) { result in
group.enter()
self.sdk.reaction.getReactionPackInfo(reactionPackID: packID) { [weak self] result in
defer { group.leave() }
guard let self = self else { return }
switch result {
case .success(let reactionPack):
self.setupReactions(reactionPack: reactionPack)
self.fetchUserReactions()
case .failure(let error):
print("Error fetching reaction pack info: \(error)")
}
}
}
group.notify(queue: .main) { [weak self] in
self?.fetchUserReactions()
}
}

@objc private func reactionButtonTapped(_ sender: UITapGestureRecognizer!) {
if let reactionView = sender.view as? ReactionView {
UIAccessibility.post(notification: .layoutChanged, argument: reactionView)
Expand Down