To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 10.0+
NuSignUp is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "NuSignUp"
This protocol exists to help user knows about his progress on sign up. Take a look on example project for ways to use it.
Each SignUpStepVC will access your instance of SignUpStackC
by self.parent
param on viewWillAppear
only to update the current step value calling the method updateForStep
, where on your implementation you should update for example your UIProgressView
progress.
override open func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
...
if let navc = self.navigationController as? SignUpStackC{
navc.updateForStep(step: stepNumber)
}
...
}
Each Sign Up Step VC must implement SignUpStepController
.
Steps that are an instance of SignUpStepVC
or SignUpNameSVC
or inherits from one of them have by default its delegate value equals to DefaultSUpSDelegate
instance.
Probably you will need to make your changes and DefaultSUpSDelegate
implementation of SignUpStepDelegate
protocol will not be enough, for these cases you have two options:
- Option 1: Your Step is an instance of
SignUpStepVC
orSignUpNameSVC
.
You can change its delegate
param value by calling:
SignUpStack.config.baseStepDelegateType(ExampleSignUpDelegate.self)
Remember that doing it all your steps that are an instance of SignUpStepVC
will use ExampleSignUpDelegate
instance as its delegate.
- Option 2: Your Step inherits from
SignUpStepVC
orSignUpNameSVC
.
Only change its delegate value.
Take a look on Example project specifically on SignUpCodeSVC
class for a safe way to do it.
SignUpStepController
has a method called goToNextStep
that on SignUpStepVC
instance executes diferent transitions accordinly to delegate.reviewMode
.
José Lucas, chagasjoselucas@gmail.com
NuSignUp is available under the MIT license. See the LICENSE file for more info.