Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
3
Answers
Already found where the problem was! Every time duplicate preview is clicked, it adds one more view in the code.
The code below shows where my "problem" was:
To fix this "problem", simply remove two ContentView() from the code:
here is the Apple documentation for the above issue it is exactly the same as the answer aforementioned
According to the documentation just delete the ContentView() you can remove the selected instance to preview
this is code is from xcode 12.4 so the slightly modify the environment
I personally believe Apple should think to provides the button on the top same as the other buttons there rather than moving around in the code. it wont cost them a lots. if you try the link above you can notice most of the people having this issue
Looks like you are trying to add multiple Hstacks one after the other. Try addding all Hstacks inside a VStack and your error should solve. Also Make sure you have only one contentView()