You can use the OPT + CMD + ENTER as the key shortcut command to hide the preview of your current SwiftUI code in Xcode:
OPT + CMD + ENTER
This keyboard shortcut allows you to switch between viewing the SwiftUI code and a live preview of the code. SwiftUI code appears in full-screen mode when the preview is hidden, and SwiftUI code appears alongside the live preview when the preview is displayed.
It’s important to note that you can also switch between viewing details by selecting “Editor” > “Canvas” > “Resume” from Xcode’s menu bar, or by clicking “Resume” in the top right corner of your canvas.