I observed the same problem with Xcode 26 beta 4, it was ok with beta 3. The problem occurs whether running Xcode 26 beta 4 on macOS 15 or macOS 26 beta 4.
Fortunately the solution I found is simple enough - adding "import SwiftUI" seems to resolve the issue for me.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: