How do I expose RK classes that are not visible in Swift?

How do I expose RK classes that are not visible in Swift?

I'm using cocoapods to add RK to my Swift project.

I need runtime access into things like the instructionLabel to set error messages during validation. The entire chain of objects down from the step view controller are hidden in *_internal.h and *_hidden.h files or are not exposed in any header.

I could just walk though all subviews until I find a ORKSubheadlineLabel.

But, the ORKSubheadlineLabel class has not been imported.

Any suggestions would be appreciated.

Accepted Reply

Edit the bridging header to include or expose any other class not mentioned in the file below that you wish to expose to the swift project provided you aren't using a binary only version of the RK framework.


Under the ResearchKit path edit ResearchKit_Private.h


You will also need to make ORKSubheadlineLabel.h, ORKDefaultFont.h, ORKLabel.h a public class in the ResearchKit build phases headers


Remember to mark this as solved.

Thanks

Replies

Edit the bridging header to include or expose any other class not mentioned in the file below that you wish to expose to the swift project provided you aren't using a binary only version of the RK framework.


Under the ResearchKit path edit ResearchKit_Private.h


You will also need to make ORKSubheadlineLabel.h, ORKDefaultFont.h, ORKLabel.h a public class in the ResearchKit build phases headers


Remember to mark this as solved.

Thanks

Thanks iTen!!!


To generalize:


1. Add the missing header file to ‘ResearchKit_Private.h’.

2. Move/add that file, plus any (recursive) imports to ResearchKit|Build Phases|Headers in the Public section.