-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Align interface to Android #31
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this @pauljohanneskraft!
I only had minor comments; happy to see this merged 🚀
|
||
|
||
/// A type handling the action to be performed by a ContactOption. | ||
public protocol ContactOptionAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably enforce that this type is sendable?
|
||
|
||
/// Encodes a way to get in contact with an individual and usually connected to a `Contact`. | ||
/// - Parameters: | ||
/// - image: The image representing the `ContactOption` in the user interface. | ||
/// - title: The title representing the `ContactOption` in the user interface. | ||
/// - action: The action that should be taken when a user chooses to use the `ContactOption`. | ||
public init(image: Image, title: String, action: @escaping @MainActor () -> Void) { | ||
public init(image: Image, title: String, action: any ContactOptionAction) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still keep the closure-base initializer; it would allow us to only tag a minor version increment and might still be useful for a Swift-style API? We could mark it as deprecated in case we don't want to have the same overload for the Android API but at least would make this a non-breaking change.
Align interface to Android
♻️ Current situation & Problem
During the implementation of SpeziContact for Android, we discussed the following changes to the interface, where iOS may benefit as well.
See StanfordSpezi/SpeziKt#104
⚙️ Release Notes
Add a bullet point list summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.
Include code snippets that provide examples of the feature implemented or links to the documentation if it appends or changes the public interface.
📚 Documentation
Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.
✅ Testing
Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.
📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: