Skip to content
This repository has been archived by the owner on Dec 27, 2020. It is now read-only.

Support for sections #7

Closed
TilBlechschmidt opened this issue Aug 23, 2019 · 4 comments
Closed

Support for sections #7

TilBlechschmidt opened this issue Aug 23, 2019 · 4 comments

Comments

@TilBlechschmidt
Copy link

It'd be very useful to have the ability to split the content into sections with a header view each much like the sections in UICollectionView.

Probably the easiest way would be to add items into the VStack that take up the full width but that probably takes some refactoring of the rowCount method.

Right now I don't have much time at hand but if nobody picks this up I might work on a PR some time next week.

@ay42
Copy link
Member

ay42 commented Aug 24, 2019

@TilBlechschmidt we just need to solve #10 and this will be possible.
With the latest release you can do the following but there will be a scroll view in each section:

    VStack(alignment: .center) {
            Section(header: Text("Section 1")) {
                Grid {
                    ForEach(0...10, id: \.self) { _ in
                        Rectangle()
                            .foregroundColor(.random)
                            .frame(height: 20)
                    }
                }
            }
            
            Section(header: Text("Section 2")) {
                Grid {
                    ForEach(0...10, id: \.self) { _ in
                        Rectangle()
                            .foregroundColor(.random)
                            .frame(height: 20)
                    }
                }
            }
        }

@melgu
Copy link

melgu commented Nov 23, 2019

@TilBlechschmidt we just need to solve #10 and this will be possible.

Has #10 been solved already, as it's closed?

@ay42
Copy link
Member

ay42 commented Nov 23, 2019

@melgu Sorry about the confusion. I meant this issue has a #10 as a dependency. #10 has been closed because I was not able to find a solution. Sections are not possible yet.

@ay42
Copy link
Member

ay42 commented Mar 14, 2020

@melgu @TilBlechschmidt this is now possible with 1.0.0 and #80

@ay42 ay42 added this to the Release 1.0.0 milestone Mar 14, 2020
@ay42 ay42 self-assigned this Mar 14, 2020
@ay42 ay42 closed this as completed Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants