0

I'm trying to change the default color of the Labels, Images, etc for Apple Research kit but haven't had any success.

Is there a configuration. Do I need to change it in AppDelegate. Could you please share a code example.

I'm not sure how to use the "appearanceWhenContainedInInstancesOfClasses".

Set tint color at UIView
UIView.appearanceWhenContainedInInstancesOfClasses([ORKTaskViewController.self]).tintColor = UIColor().darkPurple
Eric Aya
  • 69,473
  • 35
  • 181
  • 253

1 Answers1

0

Use the following for the view controller you use to call the tasks. The tint colour should change accordingly. To change colour schemes back call it after the task has finished performing. Your animations for ORKConsentDocument, and other tasks will now have the same colour tint as you chose.

    UIView.appearance().tintColor = UIColor.blue 

    // Code to do present task 

    present(taskViewController, animated: true, completion: nil)

  // in extension 

   func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskViewControllerFinishReason, error: Error?) {

    //Handle results with taskViewController.result

    taskViewController.dismiss(animated: true, completion: nil)

    UIView.appearance().tintColor = UIColor.red 

This is assuming that red is your default colour.

Nik P
  • 135
  • 9