diff --git a/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift b/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift index 5efea38e..447cca45 100644 --- a/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift +++ b/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift @@ -155,8 +155,8 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell { } imageView.update(for: avatarURL) } - for imageView in avatarStack.arrangedSubviews.dropFirst(visibleAvatars.count) { - avatarStack.removeArrangedSubview(imageView) + while avatarStack.arrangedSubviews.count > visibleAvatars.count { + avatarStack.arrangedSubviews.last!.removeFromSuperview() } actionLabel.setEmojis(pairs: people.map { ($0.displayOrUserName, $0.emojis) }, identifier: group.id) diff --git a/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift b/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift index 849357c3..d8013ff9 100644 --- a/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift +++ b/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift @@ -132,8 +132,8 @@ class FollowNotificationGroupCollectionViewCell: UICollectionViewListCell { } imageView.update(for: avatarURL) } - for imageView in avatarStack.arrangedSubviews.dropFirst(visibleAvatars.count) { - avatarStack.removeArrangedSubview(imageView) + while avatarStack.arrangedSubviews.count > visibleAvatars.count { + avatarStack.arrangedSubviews.last!.removeFromSuperview() } }