SwiftUI Disclosure Groups

preview_player
Показать описание
In this video I am going to introduce you to Disclosure Groups in SwiftUI.

I will start with a basic example and show how you can stylize them, and also show you you can programatically control the expansion and collapse of a group.

We will complete the video with a practical example where we convert a boring list view of items to a grouped list using disclosure groups that will allow for collapsing an expansion of data.

If you want to support my work, you can buy me a coffee :)

******** Download my StewartLynch YouTube Channel Application - Free ***********

Table of Contents:
0:00 Introduction
1:20 Disclosure Groups Basics
10:15 Creating a Countries Dictionary
14:15 Updating the ListView to use Disclosure Groups
16:30 Adding Collapse/Expand Buttons

Starter Project Files:

Completed Project:

References mentioned in video:
JSON Decoding Playlist
JSON Decoding Playground tester
Sorting Arrays with Multiple Criteria

Other References:
Stewart Lynch's YouTube Channel:
Stewart Lynch on Twitter:
Рекомендации по теме
Комментарии
Автор

Thanks for this Stewart.
Update for 2024: at least of Xcode 15.4, iOS 17, there is no longer different indenting amongst the different initializers.
Also, using .tint() on a DisclosureGroup will now only affect the color of the chevron, not the title/label.
Cheers.

wmblemania
Автор

I love your videos. Happy New Year from me in Norway ❤

IvanCMyrvold
Автор

Thnks for great content 🙌 I'm from 🇺🇦 so thanks a lot for your support too 🙏

vimak
Автор

Thank you for this tutorial, very good.
Why do you prefer task.sleep instead of .delay in the withAnimation-block?

thomasfahlke
Автор

Nice video, thank you for sharing as always! :)

rasheshbosamiya
Автор

Yes, i did enjoy it. So left a thumbs up and a comment :)

bashtinator
Автор

I have a scenraio where I have a list with multiple sections and inside each section I have three disclosure groups inside a ForEach, now when I expand one row all three rows (disclosure groups) are expanding...

TakasurAtWork