Hi, I'm using SwiftUI previews with the UIViewRepresentable
protocol in order to preview UIView
s. The project requires iOS 12 but I wrap the SwiftUI preview code in #if canImport(SwiftUI) && DEBUG ... #endif
, and the PreviewProvider
struct is marked with @available(iOS 13, *)
. This used to work flawlessly in Xcode 13.
But now I have a weird compilation error when running the preview:
Compiling failed: '__designTimeInteger(_:fallback:)' is only available in iOS 13.0 or newer
The relevant part of the error report is this one:
/path/to/file.swift:52:52: error: '__designTimeInteger(_:fallback:)' is only available in iOS 13.0 or newer
.init(width: UIView.noIntrinsicMetric, height: __designTimeInteger("#7274.[4].[5].property.[0].[0].arg[1].value", fallback: 44))
Line 52
only contains the initialization of a CGSize
instance:
override public var intrinsicContentSize: CGSize {
.init(width: UIView.noIntrinsicMetric, height: 44)
}
Any idea what's going on here? The project compiles without issues and the selected simulator is iPhone 8 running iOS 16.