Post

Replies

Boosts

Views

Activity

Reply to Poor ScrollView performance
I did set the symbolic breakpoint and unfortunately nothing is symbolicated. But here is one interesting thing. The warnings goes away (and performance improves) when I remove the .ignoresSafeArea that is modifying the MeshGradient. I'll keep messing around with it. Edit to add more context: So like I said removing .ignoresSafeArea works, but obviously the view will look bad. The warnings also go away when I remove the MeshGradient.
2d
Reply to Poor ScrollView performance
@patrick_metcalfe yes struct ModernStoryCardView: View { var loadedImage: Image? let bookCover: BookCover var body: some View { ZStack { VStack { ZStack(alignment: .topTrailing) { ImageOrPlaceholder() // RoundedRectangle(cornerRadius: 8) HStack { Image(systemName: "star.fill") .foregroundStyle(.yellow) .imageScale(.small) Text(bookCover.rating.description) .foregroundStyle(.yellow) .textScale(.secondary) } .padding(.vertical, 5) .padding(.horizontal, 5) .background(.ultraThinMaterial.opacity(0.3)) .clipShape(RoundedRectangle(cornerRadius: 4)) .padding(10) } Text(bookCover.title) .font(.headline) Text(bookCover.authorName) .font(.subheadline) .foregroundStyle(.primary) } } .containerRelativeFrame(.horizontal, count: 1, spacing: 10) .frame(height: 300) } @ViewBuilder private func ImageOrPlaceholder() -> some View { if let loadedImage { loadedImage .resizable() .aspectRatio(9/16, contentMode: .fill) .cornerRadius(8) } else { Image(systemName: "photo") .resizable() .aspectRatio(9/16, contentMode: .fill) .foregroundStyle(.gray) } } } struct TextRoundedRectangleView: View { let text: String let color: Color var body: some View { Text(text) .foregroundStyle(.primary) .padding(.horizontal, 10) .background(color.opacity(0.6)) .containerShape(RoundedRectangle(cornerRadius: 8)) .lineLimit(1) } }
3d