Your First iOS & SwiftUI App: Polishing the App, Episode 19: Draw the Rings | raywenderlich.com

Draw the cool rings in Luke’s design with the power of SwiftUI’s ForEach.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/28797859-your-first-ios-swiftui-app-polishing-the-app/lessons/19

So we put the ringsView into .background to Vstack. my first thought was to make a Zstack containing the ringsView and the VStack which contains the topView and bottomView but then the all the filled, stroked etc buttons where way of the screen. Like following a different size monitor. But why ?? :slight_smile:

Upload your project and I’ll have a look!

Think of the entire view like a bookshelf, and you’re stacking the books vertically with your VStack. You put a much bigger book in there (which is ringsView in this situation), and suddenly all the books on top of it are higher up than they originally were. Which is why you want to put it in the .background, as opposed to inside the VStack. When you change the .background you’re changing the bookshelf itself, and adding the rings to the back of it.

1 Like

Nice. Thanks alot !! :vulcan_salute: