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 iOS 15 crash on remote messaging #2041

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 0 additions & 2 deletions DuckDuckGo/HomeCollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ class HomeCollectionView: UICollectionView {
renderers.install(renderer: FavoritesHomeViewSectionRenderer(viewModel: favoritesViewModel))

case .homeMessage:
if #available(iOS 16.0, *) {
renderers.install(renderer: HomeMessageViewSectionRenderer(homePageConfiguration: homePageConfiguration))
Bunn marked this conversation as resolved.
Show resolved Hide resolved
}

case .appTrackingProtection:
#if APP_TRACKING_PROTECTION
Expand Down
10 changes: 6 additions & 4 deletions DuckDuckGo/HomeMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ struct HomeMessageView: View {
@State var activityItem: ShareItem?

var body: some View {
ZStack {
closeButtonHeader

ZStack(alignment: .topTrailing) {
VStack(spacing: 8) {
Group {
topText
Expand Down Expand Up @@ -78,6 +76,11 @@ struct HomeMessageView: View {
.multilineTextAlignment(.center)
.padding(.vertical)
.padding(.horizontal, 8)

closeButtonHeader
.alignmentGuide(.top) { dimension in
dimension[.top]
}
}
.background(RoundedRectangle(cornerRadius: Const.Radius.corner)
.fill(Color.background)
Expand All @@ -97,7 +100,6 @@ struct HomeMessageView: View {
closeButton
.padding(0)
}
Spacer()
}
}

Expand Down