I've had the same problem with the 16.0 RC but while using my own custom AlignmentID. Unfortunately, removing explicit checks for == nil didn't work, but I did eventually figure out I could make the Alignment nonisolated and that appears to have fixed the problem.
extension HorizontalAlignment {
private enum MyAlignment: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
context[HorizontalAlignment.center]
}
}
nonisolated // Crashes without this
static let myAlignment = HorizontalAlignment(MyAlignment.self)
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: