|
Hi, I'm trying to get Xcode to build a particular view to run in the Simulator or on the Phone, which is useful when Paul has multiple views in his xcode project. (Project6 in this case) However, when I try to run the below code, I get an error: Command CompileSwiftSources failed with a nonzero exit code Google hasnt helped me resolve it. Can anyone tell me what I am doing wrong?
|
|
@randmtask doesn't have a clear view of the problem:
First, you are asking the right questions. There are a number of programmers here eager to help you grok this material. Next, take a step back from your code and look at it from the compiler's point of view. I like to think of a But your preview code is telling SwiftUI to assemble a view from a (Lego) kit named Your This is fine, but does nothing. Toggling this boolean has no effect on the other Lego kit, This may not be the root of the problem, but I'd start there to eliminate unnecessary confusion. Keep Coding |
|
One other thought. You may find the compiler reminding you that the Instead, the newer version of this modifier asks you to include a Suggest changing the modifier to:
|
|
Finally, here's what I think about Please add your own thoughts to the discussion. |
|
If you want to have all the animation in one project Make a NEW
and then make a NEW
Then in the
This will not produce any errors. |
SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.