Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Crash navigating to notification options - WPB-11062 #2021

Merged
merged 2 commits into from
Oct 15, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ final class ConversationNotificationOptionsViewController: UIViewController {
return UICollectionView(frame: .zero, collectionViewLayout: self.collectionViewLayout)
}()

private lazy var sizingFooter = SectionFooter()

// MARK: - Initialization

init(conversation: ZMConversation, userSession: ZMUserSession) {
Expand Down Expand Up @@ -133,16 +135,14 @@ extension ConversationNotificationOptionsViewController: UICollectionViewDelegat
}
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
let dequeuedView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionFooter,
withReuseIdentifier: "SectionFooter",
for: IndexPath(item: 0, section: section))

guard let view = dequeuedView as? SectionFooter else { return .zero }

view.titleLabel.text = L10n.Localizable.GroupDetails.NotificationOptionsCell.description
view.size(fittingWidth: collectionView.bounds.width)
return view.bounds.size
func collectionView(
_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
referenceSizeForFooterInSection section: Int
) -> CGSize {
sizingFooter.titleLabel.text = L10n.Localizable.GroupDetails.NotificationOptionsCell.description
sizingFooter.size(fittingWidth: collectionView.bounds.width)
return sizingFooter.bounds.size
}

// MARK: Saving Changes
Expand Down
Loading