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

Issue adding an image to an OCKChecklistTaskViewController card #524

Closed
gabe-l-rivera opened this issue Nov 28, 2020 · 1 comment · Fixed by #579
Closed

Issue adding an image to an OCKChecklistTaskViewController card #524

gabe-l-rivera opened this issue Nov 28, 2020 · 1 comment · Fixed by #579

Comments

@gabe-l-rivera
Copy link

gabe-l-rivera commented Nov 28, 2020

I cannot find a way to add an image to an OCKChecklistTaskViewController card. In the attachment, the top portion above the instructions and label is light gray- this is where the image should go.

github issue carekit 2

@erik-apple
Copy link
Collaborator

We should tweak CareKit to display the task's asset in this view by default.

In the meantime, you can set the image to whatever you'd like by subclassing the view controller.

class MyTaskViewController: OCKChecklistTaskViewController {


    /// Create a detail view that displays information about a task.
    /// - Parameter indexPath: Index path of the event whose task should be displayed.
    override func initiateDetailsViewController(forIndexPath indexPath: IndexPath) throws -> OCKDetailViewController {
        
        let detailViewController = super.initiateDetailsViewController(forIndexPath: indexPath)

        detailViewController.detailsView.imageView.image = /* Anything you want */

        return detailViewController
    }
}

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 a pull request may close this issue.

2 participants