Skip to content

cosalexelle/VerticalPageScrollView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VerticalPageScrollView

An imperfect, pure Swift UI implementation of a vertically-scrolling page view, with indicators of the current selected page.

WARNING: This is very unoptimised code, it may have issues and is provided without warranty.

Example Usage

import SwiftUI

struct ContentView: View {
    
    @State private var colors: [Color] = [
        .orange,
        .purple,
        .cyan,
        .indigo
    ]
    
    var body: some View {
        VerticalPageScrollView{
            ForEach(colors, id: \.self){ color in
                ZStack{
                    Rectangle()
                        .fill(color.gradient)
                    Text("\(color.description)")
                        .font(.title.weight(.bold))
                }
                .frame(maxWidth: .infinity, maxHeight: .infinity)
            }
        }
        .showIndicators()
        .pageSpacing(.large)
        .ignoresSafeArea()
    }
}

Bugs

(to be listed shortly)

  1. Using spacing of .none (0.0) between views causes some flickering at the bottom / top of view. Hence the default option adds spacing between each view.

TODO:

Basically everything...

License

The Unlicense

About

An imperfect, pure Swift UI implementation of a vertically-scrolling page view.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages