I have an Xcode project, with a nested Framework.
The nested framework contains a Swift class I would like to use, that uses the @objcMembers public class
.
@objcMembers public class SPDetailedStringPicker : UIViewController {
}
I want to use this Swift class in my base project.
I’ve tried many import methods such as using:
#import "MyNestedFramework/MyNestedFramework-Swift.h"
also tried:
#import "MyNestedFramework-Swift.h"
but no luck.
The project structure looks like this:
- MyProject
- MyNestedFramework.xcodeproj
- Classes
- The Swift class I want to use
- MyProject
- Classes
- The Objective c class I want to use that swift class in
2
Answers
Thanks to @arturdev 's suggestions - I managed to fix the issue.
It was suggested to check the compiled frameworks headers under:
The
MyNestedFramework-Swift.h
header file was being generated. I then opened up the build phases tab underMyNestedFramework
and opened theHeaders
section, then added the actualMyNestedFramework.Framework
to the project.I am now able to use the Swift files from
MyNestedFramework
in my base project by importing:Use
<>
instead of"
#import <MyNestedFramework/MyNestedFramework-Swift.h>