f1f7547e92bc562dca027461b91b217350002bf6
StepperView
SwiftUI iOS component for Step Indications.
Usecase
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
Requirements
- iOS 13.0+
- Xcode 11.2+
- Swift 5.0+
- CocoaPods 1.6.1+
Installation
StepperView is available through CocoaPods. To install it, simply add the following line to your Podfile.
pod 'StepperView'
Swift Package Manager
StepperView is available through Swift Package Manager. To install it, simply add the following dependency to your Package.swift
.package(url: "https://github.com/badrinathvm/StepperView.git", from: "1.1.2")
Usage
import StepperView
let alignments = [StepperAlignment.top,.center,.bottom]
let indicatorTypes = [ StepperIndicationType<AnyView>.circle(Colors.teal.rawValue, 12),
StepperIndicationType.image(Image(systemName: "arrow.right.circle", 12)),
StepperIndicationType.image(Image(systemName: "arrow.uturn.right", 12))
]
var body: some View {
var body: some View {
StepperView(cells: [cellBody, cellBody , cellBody],
alignments: alignments,
indicationType:indicatorTypes,
lineOptions: StepperLineOptions.custom(1,Colors.gray.rawValue))
}
}
var cellBody:some View {
VStack(alignment: .leading) {
ForEach(["Top","Center","Bottom"], id:\.self) { value in
HStack {
Text(value)
.foregroundColor(Color.gray)
.padding(.vertical , 10)
.padding(.horizontal, 5)
Spacer()
}
}
}
}
Parameters
- cells : array of views to be rendered next to step Indicator
- alignments: defaults to .center, for custom options pass list of view alignments to be pointed for eg: can be .top , .center , .bottom sections
- indicatorTypes: enum provides the options to use .circle(color, width) , .image(Image, width) or .custom(AnyView)
- lineOptions: optional parameter to customize the line for thickness and color options.
- verticalSpacing: optional parameter for vertical spacing
Refer Example for more details on usage of StepperView
Author
Badarinath Venkatnarayansetty
Contact
Follow and contact me on Twitter or LinkedIn. If you find an issue, just open a ticket. Pull requests are welcome.
License
StepperView is available under the MIT license. See the LICENSE file for more info.
Description
SwiftUI iOS component for Step Indications.
apple-watchcarthagecocoapodsiosstepindicatorstepperviewswiftswift-package-managerswiftuitimelineworkflow
Readme
MIT
22 MiB
Languages
Swift
99%
Ruby
1%