|
When I enter in the code of the instructor for custom modifiers for watermarked it does not show up in the lower right hand corner of the blue rectangle. It shows up in another content view in the preview and and below the blue box in the ios simuator.
|
|
@morpheus doesn't have the complete view of their problem....
Please review your code below and note that you are providing TWO views in this body function. However, you're telling the compiler that it should only draw ONE view.
The XCode preview is more forgiving than a simulator. Instead of complaining, the preview will show you both views, but in two separate preview windows. How might you combine the two views into one view? Consider your options! Please return here and tell us your solution. Keep coding! |
|
I'm not following. I thought I typed in the code the same way as the instructor. How am I providing two views? |
|
I figured it out. The instructor added a ZStack to the code and that presented one view.
|
|
Well done!I could have just given you the answer. But I think you learn more trying to seek the answer. Do you see now? Do you understand how you were asking the compiler to draw TWO views? What did the ZStack do? It combined your two views into one ZStack view as you noted. Keep codingAlso, please mark an answer as Solved. |
|
While
It put second Note that always check your code it so easy to miss something then it will not work as expected! |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure and A/B test your entire paywall UI without any code changes or app updates.
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.