All Projects → Onaeem26 → SwiftyUIScrollView

Onaeem26 / SwiftyUIScrollView

Licence: other
A custom ScrollView wrapper that comes with Pagination and Page Control.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to SwiftyUIScrollView

AdvancedList-SwiftUI
MOVED to https://github.com/crelies/AdvancedList | Advanced list with empty, error and loading state implemented with SwiftUI
Stars: ✭ 41 (+127.78%)
Mutual labels:  pagination, swiftui
Builder
Demonstrates SwiftUI builder patterns for UIKit and networking.
Stars: ✭ 100 (+455.56%)
Mutual labels:  swiftui
kaminari-sinatra
Kaminari Sinatra adapter
Stars: ✭ 26 (+44.44%)
Mutual labels:  pagination
app
💥 a modern xkcd iOS client
Stars: ✭ 31 (+72.22%)
Mutual labels:  swiftui
MVVM-in-SwiftUI
MVVM in SwiftUI (WWDC Player)
Stars: ✭ 60 (+233.33%)
Mutual labels:  swiftui
spring-boot-jpa-rest-demo-filter-paging-sorting
Spring Boot Data JPA with Filter, Pagination and Sorting
Stars: ✭ 70 (+288.89%)
Mutual labels:  pagination
DarkModeSwitcher
Simple app for overriding light mode per app on macOS (demo for a blog post)
Stars: ✭ 37 (+105.56%)
Mutual labels:  swiftui
RChat
No description or website provided.
Stars: ✭ 58 (+222.22%)
Mutual labels:  swiftui
NumberTicker
Robinhood-like Rotating Number View | SwiftUI
Stars: ✭ 34 (+88.89%)
Mutual labels:  swiftui
LineChartView
An interactive line chart written in SwiftUI with many customizations (colors, line size, dots, haptic feedbacks). Support value and time series.
Stars: ✭ 59 (+227.78%)
Mutual labels:  swiftui
RealmTaskTracker
SwiftUI version of the MongoDB Realm iOS tutorial
Stars: ✭ 24 (+33.33%)
Mutual labels:  swiftui
stinsen
Coordinators in SwiftUI. Simple, powerful and elegant.
Stars: ✭ 563 (+3027.78%)
Mutual labels:  swiftui
Micro
🏎Fast diffing and type safe SwiftUI style data source for UICollectionView
Stars: ✭ 77 (+327.78%)
Mutual labels:  swiftui
Bursts
A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI
Stars: ✭ 11 (-38.89%)
Mutual labels:  swiftui
NavigationRouter
A router implementation designed for complex modular apps, written in Swift
Stars: ✭ 89 (+394.44%)
Mutual labels:  swiftui
go-paginate
Cursor-based go paginator
Stars: ✭ 48 (+166.67%)
Mutual labels:  pagination
RxPagination
Implement pagination in just few lines with RxPagination
Stars: ✭ 20 (+11.11%)
Mutual labels:  pagination
LongWeekend-iOS
🏖📱 LongWeekend is iOS Application that supports checking long weekends when taking a vacation in Japan
Stars: ✭ 19 (+5.56%)
Mutual labels:  swiftui
memorize
Stanford University's course CS193p (Developing Applications for iOS using SwiftUI)
Stars: ✭ 20 (+11.11%)
Mutual labels:  swiftui
CombineUnsplash
A sample project exploring MVVM pattern with SwiftUI/Combine, using Unsplash API (via Picsum.photos API)
Stars: ✭ 25 (+38.89%)
Mutual labels:  swiftui

SwiftyUIScrollView

A custom ScrollView wrapper that comes with Pagination and Page Control.

Wrap HStack or VStack with the custom SwiftUIScrollView to get pagination and page control features. The initializer for the wrapper is:

init(axis: DirectionX, numberOfPages: Int,
         pagingEnabled: Bool,
         pageControlEnabled: Bool,
         hideScrollIndicators: Bool,
         currentPageIndicator: UIColor?,
         pageIndicatorTintColor: UIColor?,
         @ViewBuilder content: @escaping () -> Content)

This is how the above custom wrapper could be used:

SwiftyUIScrollView(axis: .horizontal, numberOfPages: self.contentArray.count, pagingEnabled: true, pageControlEnabled: true, hideScrollIndicators: true) {
                    HStack(spacing: 0) {
                        ForEach(self.contentArray, id: \.id) { item in
                            TestView(data: item)
                                    .frame(width: g.size.width, height: g.size.height)
                        }
                    }
            }.frame(width: g.size.width)

The DirectionX enum contains two directions:

enum DirectionX {
    case horizontal
    case vertical
}

If you are using HStack, make sure you set the axis in initializer to- .horizontal, if using VStack make sure you use .vertical. This is madatory in order to have pagination and page controls to work for both directions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].