Skip to content

ScrollView wrapper that makes you build complex lists easily

Notifications You must be signed in to change notification settings

kkiermasz/Collection

Repository files navigation

This repository was created for the purpose of article on Medium.

Collection

Collection is a simple wrapper for a ScrollView, to facilitate the creation of complex list layouts in SwiftUI. This is a kind of workaround for the lack of collection view in SwiftUI.

It allows your main view to look like this:

struct MountainsView: View {
    @ObservedObject private var viewModel = ViewModel()
    
    var body: some View {
        NavigationView {
            Collection(showsIndicators: false, model: viewModel.sections) {
                MountainRangesSection()
                MountainsSection()
            }
            .navigationTitle("Mountains list")
        }
    }
}

Demo

The example project can be found in the workspace associated with the project. Remember that you have to build the package first.

License

Collection is shared under the MIT license. See the LICENSE for more info.

About

ScrollView wrapper that makes you build complex lists easily

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages