Hello,
I'm having an issue with SwiftUI Preview in Xcode. When I switch between different iPhone models, including iPhone 18 Pro, iPhone 18 Pro Max, iPhone Air, and iPhone Duo, the selected device name changes, but the actual device appearance and preview dimensions remain exactly the same.
This happens in all SwiftUI projects, including newly created ones.
I've tried reinstalling Xcode, clearing DerivedData and caches, and even performing a clean macOS installation, but the issue still persists.
- macOS 27.0.1
- Xcode 27.2
Has anyone experienced this issue or found a solution?
Thank you!
Hi,
Sorry to hear you are having problems getting previews to work as you expected. The canvas uses Xcode's current run destination just as a hint for what platform and idiom the device it uses for the preview should be. To use a specific device of your choosing (like iPhone 16 instead of the iPhone 18 Pro) you'd want to use this button and pick something different than the default Automatic choice.
Hope that helps!