Xcode: iOS Project - I cannot select individual items in the preview canvas

Hello,

I am currently creating a component in swiftUI and I would like on xcode to be able to select the elements individually with the selector button on the xcode preview on the canva but when I click on an element it selects all the iphone and not the element individually how can I do this please?

Hi,

Sorry to hear you are having problems getting selection working in previews. The feature currently only supports selecting individual elements if those elements are the result of code in the local file.

This means you should be able to click on a Text(…) that is defined within the body of a View that is defined in the current file, but if your body creates an instance of a View defined in another file that contains that Text then you won't be able to click to select it.

I am sure that's not what you were hoping for, but did my explanation make sense?

If you are finding that even with a simple file (like the one Hello World one in the new-project template) that selection still doesn't work, then that sounds like a bug worthy of a feedback report. If you file one of those, it'd be good to include:

  1. a zip of the entire project you reproduced with (all source files, not just the .xcodeproj), and
  2. a screen recording of how you are attempting to select things in the canvas

Hello, it's a project I can't share here. Is it possible to send you a mp?

For reasons of confidentiality I've removed what's on the preview - you can see the blue outline when I try to select an item.

Xcode: iOS Project - I cannot select individual items in the preview canvas
 
 
Q