Search code examples
iosswiftresearchkit

Researchkit customization


I would like to customize look of survey. To be precise, I would like to:

  1. set background image like I can do on any other ViewController

demo code:

// Set View background image.
UIGraphicsBeginImageContext(self.view.frame.size)
UIImage(named: "ViewController-Background")?.drawInRect(self.view.bounds)
var image: UIImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
self.view.backgroundColor = UIColor(patternImage: image)
  1. and maybe even customize tintColor of Navigation bar (throughout whole app color is white as background is dark, but with default white background on Survey, white letters in status bar and navigation controller are not visible (for example Cancel button).

  2. Since some questions use tableview for response, can I customize so its cells are transparent and text white?

I failed to do this like suggested in iOS research kit survey (swift)

Since I cannot post reply there due to some reputation limit, I am forced to ask here for additional help.

I am very thankful in advance for any tips, hints, samples , demos or code. Preferably in Swift if possible.

Thanks!


Solution

  • Function from the answer on the link manages for iOS 8 users to access elements. appearanceWhenContainedIn in Swift

    In combination with the discussion: https://github.com/ResearchKit/ResearchKit/issues/508