Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1020 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 1020 Bytes

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.