Post

Replies

Boosts

Views

Activity

Reply to .alignmentGuide modifier causes consistent app crash when Swift 6 language mode is enabled
I was able to workaround the crash by adding @Sendable in the closure view.alignmentGuide(VerticalAlignment.center) { @Sendable dimension in dimension[VerticalAlignment.center] } you can also create an extension directly with @Sendable view.alignmentGuideFixed(VerticalAlignment.center) { dimension in dimension[VerticalAlignment.center] } extension View { nonisolated func alignmentGuideFixed( _ alignment: HorizontalAlignment, computeValue: @escaping @Sendable (ViewDimensions) -> CGFloat ) -> some View { self.alignmentGuide(alignment, computeValue: computeValue) } nonisolated func alignmentGuideFixed( _ alignment: VerticalAlignment, computeValue: @escaping @Sendable (ViewDimensions) -> CGFloat ) -> some View { self.alignmentGuide(alignment, computeValue: computeValue) } }
Oct ’24