ResearchKit: Is it possible to import Swift Code into Objective-C files ( .h and .m).

I've currently forked the most recent version of ResearchKit (as of July 7, 2022) and am trying to make a new ORKInstructionStep that uses Swift objects that I'm importing from a different Swift-based project.

This is running in XCode 14.0.

I put the following Swift files into my forked version of ResearchKit as circled and shown below.

I then went to ResearchKit -> Targets -> ResearchKit -> Build Settings -> Defines Module and set it to "Yes." I then also went to ResearchKit -> Targets -> ResearchKit -> Build Settings -> Bridging Header and set it to "ResearchKit/ResearchKit-Bridging-Header.h."

I then went to ORKVideoInstructionsViewController.h and added the following import statement:

I then went to one of the Swift class I imported and added the public keyword to the objects I wanted to instantiate in ORKVideoInstructionsViewController.m.

I then tried to instantiate a VideoProcessingChain object in the ORKVideoInstructionsViewController.m file as shown below and ran into the following errors.

Post not yet marked as solved Up vote post of bkosa2 Down vote post of bkosa2
64 views