Skip to content

leechoohyoung/HorizontalPageControl

Repository files navigation

HorizontalPageControl

CI Status Version License Platform

Demo

DemoGIF

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 17.0, Swift 5

Installation

HorizontalPageControl is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'HorizontalPageControl'

Usage

var body: some View {
    let config = ...
    HorizontalPageControl(config: ...) {
        // implement your views here
    }
    .onPageChanged { oldValue, newValue in
        print("oldValue:\(oldValue), newValue:\(newValue)")
    }
    .onIndicatorTouched { scrollViewProxy, index in
        print("you can scroll to specific page programmatically via scrollViewProxy:\(scrollViewProxy), index:\(index)")
    }
}

Author

[email protected]

License

HorizontalPageControl is available under the MIT license. See the LICENSE file for more info.

About

Simple Horizontal Page Control for iOS written SwiftUI.

Resources

License

Stars

Watchers

Forks

Packages

No packages published