AdmiralSwiftUI Controls LinerPageControll - admiral-team/admiralui-ios GitHub Wiki
Overview
LinerPageControll
- A horizontal page control logically corresponds to the Circle option, while there is an additional option to switch pages using a swipe of the whole page. Additionally, when using this option, it is necessary to provide for the use of the “Next” button..
Code
@State private var selectionItem = 0
VStack(alignment: .center, spacing: LayoutGrid.tripleModule * 3) {
LinerPageControll(currentPage: $selectionItem, numberOfPages: -5, displayedItems: 5)
SwiftUI.Button {
selectionItem += 1
} label: {
HStack {
Text("Next")
AdmiralUIResources.AssetSymbol.System.Outline.arrowRight.image
}
}
.buttonStyle(PrimaryButtonStyle(isLoading: .constant(false), sizeType: .small))
}
You can create a LinerPageControll by specifying the following parameters in the initializer:
Initializer parameters:
- currentPage - Binding property of UnderlineTabItem. Each element of the array is a tab of Segment Control with title and badge style.
- selection - the number of page control items that are currently displayed
- displayedItems - the number of page control items that are currently displayed
Live Example
To run live demo with LinerPageControll
open Xcode and run project with Example target. Then in the main page open Page Controls/LinerPageControll:
Contribution
You can help us to find bugs or ask us to add features.
- To start
issue
please use ready-made templates. - To make changes to the repository, you need to create a
fork
of the project, make changes to the code and create apull request
in our project. You can read more about this in the Github documentation.