HorizontalPageControl
示例
要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install
。
要求
iOS 17.0, Swift 5
安装
HorizontalPageControl可通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中
pod 'HorizontalPageControl'
使用方法
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)")
}
}
作者
许可证
HorizontalPageControl受MIT许可协议的保护。有关更多信息,请参阅LICENSE文件。