From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Shape modifiers

Shape modifiers

- [Instructor] While we've looked at padding with positive values, I can also use negative numbers here to bring views closer together. So let's go over to menu row view for an example here. So I'm going to go over here to the image and underneath that, I'm going to put padding and I'm going to make it a negative padding to the trailing side. And that might not look really good 'cause we've actually now overlapped the two. But I did it for a reason. You'll use this often along with shapes and shape modifiers. The most common of these is clip shape, which adds a mask to the image. So you can have different shaped images. So for example, above the padding, I'm going to add a clip shape. And it says there's a shape. Now shapes are actually views. And I'm going to put in that view here for circle. And now my image gets cut so that it is a circle and you can only see part of the image and you can see why I now moved it over 'cause you can now use this modifier and I can actually move it…

Contents