Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

ruisebas
Copy link
Member

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.

@ruisebas ruisebas requested review from a team as code owners April 23, 2024 16:17
@ruisebas ruisebas merged commit 3a2a9b0 into main Apr 23, 2024
3 checks passed
@ruisebas ruisebas deleted the feat/empty-states branch April 23, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants