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

Add generic SwiftUI Error type #5742

Merged
merged 3 commits into from
Mar 7, 2022
Merged

Add generic SwiftUI Error type #5742

merged 3 commits into from
Mar 7, 2022

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Mar 3, 2022

Adds a generic ErrorAlertType struct that can be used to describe an Alert to be presented. We can pass an NSError to the init to use it in a similar way to the existing errorPresenter in the UIKit templates. Additionally replaces LocationSharingErrorAlertInfo and TimelinePollErrorAlertInfo with this new type.

@stefanceriu WDYT about the style of having the ErrorAlertType.alert property where the type creates and returns the view? I'm perfectly happy with this when it's simple, but happy to revert it back to the previous commit where there is only a convenience property for the messageText if you prefer?

Note: I haven't tested the errors for polls/location sharing.

Adopt it in Location Sharing and Polls.
@pixlwave pixlwave marked this pull request as ready for review March 3, 2022 16:54
@github-actions
Copy link

github-actions bot commented Mar 3, 2022

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/waijU5

Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, everything looks great to me 👏

@langleyd
Copy link
Member

langleyd commented Mar 4, 2022

nice!

@pixlwave pixlwave merged commit e8f0696 into develop Mar 7, 2022
@pixlwave pixlwave deleted the doug/swiftui_errors branch March 7, 2022 13:34
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.

3 participants