Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Resize a Shape Without Affecting The Layout of Other Views

Resize a Shape Without Affecting The Layout of Other Views

Daily Coding Tip 167

Millie Sturgeon's avatar
Millie Sturgeon
Sep 07, 2022
∙ Paid

Share this post

Type Safely
Type Safely
Resize a Shape Without Affecting The Layout of Other Views
Share
blue lemon sliced into two halves
Photo by davisuko on Unsplash

Shapes can be resized using the .size modifier. This is somewhat similar to adding padding to the trailing and bottom edges, since the shape will shrink as such padding increases.

But padding also increases the size of the frame, so it’s only really equivalent to when a fixed frame size has been provided.

This code sample allows you to modify the size and frame of a Rectangle, and to see those changes in real time.

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share