1 min read
Register
Last Updated - Platform 20.0 - SDK 15.0The Register screen allows a user to create an account and handles the initial authentication.
Once a user has been logged in the Authenticator handles authenticating requests.
Deeplinks
To navigate to the Register screen use:
app://signup
To present the Register screen modally use:
app://signup?is_modal=true
Builder
Use a RegisterBuilder
to build a RegisterViewController
.
let builder = RegisterBuilder()builder.alertMiddleware = .customErrorMiddleware()
let viewController = builder .withServiceMiddleware(.customRegisterService()) .build() as CustomRegisterViewController
Generics
- Replace
RegisterState
using the genericRegisterBuilder<CustomState>
constraint. - Replace
RegisterViewController
with a subclass by inferring using.build() as CustomViewController
.
Reducers
- Replace
registerReducer
to handle form changes (user interaction). - Replace
serviceReducer
or use.withServiceReducer()
to handle API responses. - Add additional reducers using
.withReducer()
.
Middleware
- Replace
serviceMiddleware
or use.withServiceMiddleware()
to handle registration. - Replace
alertMiddleware
to present error alerts or toasts whilst loading. - Replace
routerMiddleware
or use.withRouterMiddleware()
to handle navigation. - Replace
analyticsMiddleware
or use.withAnalyticsMiddleware()
to handle analytics. - Add additional middleware using
.withMiddleware()
.
Presentation
- Replace
view
, use.withView()
or use containers to replace the view. - Replace
viewDataMapper
, use.withViewDataMapper()
or use containers to replace the mapper.
Building
- Use
.build()
to return the view controller. - Use
.build(with:)
to customise the initial state.
Injection
Use Container.shared
to customise services, mappers, views and more. Put this code at the beginning of setUpAccount
, or (for shared dependencies) in setUpDependencies
. See the full list of Login dependencies below.