Implemented Simple and Detailed Contact Views in SwiftUI #477
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
This PR introduces simple and detail contact views in the SwiftUI part of CareKit and CareKitUI.
Interesting points
In the Detailed Contact View, I couldn't use
.subheadline
Font style because it only allows a single line of text. That's probably a bug in SwiftUI. The same code is being used in the InstructionsTaskView alongside with.lineLimit(nil)
which doesn't have any effect to the line limit.The HeaderView didn't contain any image up until now. So included the image. We still don't have a way to populate images for contacts in CareKit so all images are just system placeholders for now.
The size of the image and scale of the fonts doesn't correspond 1:1 to the UIKit version. This is because we are using the predefined sizes. If we wanted to use different sizes for these use-cases, we would have to define them in constants.
Looking forward to your feedback!