aws-amplify / amplify-ui-swift-authenticator

The Amplify UI Authenticator is a component that supports several authentiation flows using Amplify Authentication.
https://ui.docs.amplify.aws/swift/connected-components/authenticator
Apache License 2.0
15 stars 9 forks source link

chore: Adding Factory for empty and no-op States that can be used in SwiftUI's previews. #67

Closed ruisebas closed 6 months ago

ruisebas commented 6 months ago

Issue #, if available:

Description of changes:

This PR introduces a PreviewFactory that provides developers with empty and no-op States that can be used in Xcode's Previews when implementing customized views.

For example:

import Authenticator

struct CustomSignInView: View {
    @ObservedObject var state: SignInState

    var body: some View { /*...*/ }
}

#Preview {
    CustomSignInView(
        state: PreviewFactory.States.signIn()
    )
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.