Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Control Whether a List Section Is Collapsible By The User
Copy link
Facebook
Email
Notes
More

Control Whether a List Section Is Collapsible By The User

Daily Coding Tip 240

Type Safely's avatar
Type Safely
Feb 01, 2023
∙ Paid

Share this post

Type Safely
Type Safely
Control Whether a List Section Is Collapsible By The User
Copy link
Facebook
Email
Notes
More
Share
brown chest near wall
Photo by Gaelle Marcel on Unsplash

There’s a modifier on Section called .collapsible() that takes a bool.

I thought it could be used on any platform, but it turns out that it’s exclusive to macOS. With that in mind I created a SwiftUI macOS app and added a List. The modifier only works with .listStyle(.sidebar), so I did that too. I’m starting with a Sect…

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

Copy link
Facebook
Email
Notes
More