-
Notifications
You must be signed in to change notification settings - Fork 445
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
Implemented Simple and Detailed Contact Views in SwiftUI #477
base: master
Are you sure you want to change the base?
Conversation
Merge with apple
SwiftUI - Simple and Detail Contact Views
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.
Looks like a good start!
I left number of comments in-line.
There is still a bit of work to do connecting the contact controller to the contact view model, but we're happy to provide guidance on that if you get stuck!
CareKit/CareKit/Shared/Extensions/OCKContactController+Extensions.swift
Outdated
Show resolved
Hide resolved
CareKit/CareKit/Shared/Extensions/OCKContactController+Extensions.swift
Outdated
Show resolved
Hide resolved
@erik-apple thanks for the feedback and explanation on some of the things - I'll follow up shortly! |
…esTech/CareKit into feature/swiftUIcontact
Feature/swift u icontact
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!