Skip to content

GREENOVER/SuperStepper

Repository files navigation

스크린샷 2022-02-05 오전 9 48 57 Platform: iOS 14.0+ Language: Swift 5 Version Carthage Compatible License

What is SuperStepper?

Everyone can be used and customized in various ways without errors in SwiftUI
Existing Stepper don't working properly in navigationLink
But SuperStepper made up for them
Actually, It's so convenient to use 🙌

Various customized SuperStepper

1 2 1
123 2 23

How to use SuperStepper?

Just crazy simple
import SuperStepper first 💪

  • Basic
struct YourView: View {
  @State var count: Int = 1
  
  var body: some View {
    VStack {
      SuperStepperView(count: $count)
      Text("count number is \(count)")
    }
  }
}

need to state property for binding with SuperStepper

  • Customize
struct YourView: View {
  @State var count: Int = 1
  
  var body: some View {
    VStack {
      SuperStepperView(
        count: $count,
        steppingCount: 2,
        minimumCount: 10,
        maximumCount: 30,
        decreaseTitleText: "DOWN",
        increaseTitleText: "UP",
        decreaseTitleColor: .red,
        minimumDecreaseTitleColor: .gray,
        increaseTitleColor: .blue,
        maximumIncreaseTitleColor: .gray,
        decreaseTitleFont: .body,
        increaseTitleFont: .body,
        separatorColor: .black,
        seperatorWidth: 5,
        separatorHeight: 20,
        backgroundColor: .yellow,
        borderColor: .blue,
        borderLineWidth: 1,
        cornerRadius: 5,
        stepperSpacing: 5
      )
      Text("count number is \(count)")
    }
  }
}

Everything we want 😀
If your're curious, use the code in the example forlder

Update list by version

v0.1.1 ✨ The initial setting of the SuperStepper
v0.1.2 ♻️ Modularize the SuperStepper
v0.1.3 ✨ Add the disabled function of the button
♻️ Change the button font we want
✨ Change the SuperStepper border we want
✨ Add support SPM
v1.0.0 ✨ Add Support Carthage
v1.1.0 ✨ Add increment and decrement arguments

Requirements

only can use in SwiftUI

  • iOS >= 14.0
  • Xcode 11 / Swift 5

Cocoapods Install

Add pod 'SuperStepper' to your Podfile.
SuperStepper is available through CocoaPods.
To install it, simply add the following line to your Podfile:

pod 'SuperStepper'

Swift Package Manager Install

dependencies: [
    .package(url: "https://github.com/GREENOVER/SuperStepper.git", .upToNextMajor(from: "1.1.0"))
]

In the Xcode 13.0+ enter SuperStepper URL in Add Package Dependency

https://github.com/GREENOVER/SuperStepper  

Carthage Install

Add below code in your Cartfile

github "GREENOVER/SuperStepper" ~> 1.1.0

How to contribute

In the case below, please send us a PR 🙌

  • Typo correction
  • Add a better Feature
  • Fix Error
  • Better clean code
  • And everything else that you think of

Special Thanks

Please contribute and take your place 🙇🏻

Author

GREENOVER, [email protected]

License

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