I believe that your problem may not be available to access modifiers in your Swift class, however I wrote a short reference and sample project to help you:
An example project can be found here.
There are two parts that have a mixed language structure:
- Import Objective-C into Swift
- Import Swift in Objective-C
1. Import Objective-C into Swift
This is, for example, if you have an Objective-C class named Player that you want to add to the quick class named Game .
According to the documentation, you need to complete these two steps in order to import the Player object into the Game object.
- In the Assembly Options section of the Packaging section, verify that the Define Module option for this target framework environment is set to Yes.

In the header of your header file, import each Objective-C header that you want to open in Swift.
#import <Framework/Player.h>
Ensure that the Player header in Objective-C is marked for public target membership under:

After these steps, you can import the Player Objective-C class into the Game Swift class:
import UIKit public class Game: NSObject { public let player: Player public init(player: Player) { self.player = player super.init(); } }
2. Import Swift into Objective-C
To import the Swift Game class into a Player object, we can perform a similar procedure.
- As before; In the Assembly Options section of the Packaging section, verify that the Define Module option for this target environment is set to Yes.

Import Swift code from this target environment into any Objective-Cm file within this target environment using this syntax and substituting the appropriate names:
#import <ProductName/ProductModuleName-Swift.h>
In my case, it works like:
#import <SwiftObjC/SwiftObjC-Swift.h>
and I suppose for you:
#import <MyKit/MyKit-Swift.h>
Therefore, make sure that all the properties, methods, and classes that you want to access are defined as public in your fast file, otherwise they will not be visible in Objective-C.
I downloaded my sample project showing how it all works on GitHub https://github.com/elliott-minns/SwiftObjCTestFramework
Hope this helps you solve your problem.
Elliott minns
source share