Framework not visible in auto-generated swift file

578 Views Asked by At

I want to import some swift classes in objective-c project. I added all classes, I created the bridging-header, I imported the MyTarget-swift.h file in my classes and everything seems working fine.

When I'm building the project, I found a very strange error on generated swift.h file:

enter image description here

StoreKit framework is already added to project. I have no idea what is going on. Anybody has any idea?

1

There are 1 best solutions below

0
Gaby Fitcal On

The right answer is this: https://stackoverflow.com/a/24195188/4563329

That helped me to fix my problem. I will post my fixed file here:

I created another header file in objective-c named ModuleTargetName-Swift-Fixed.h Inside of it first I imported StoreKit and after I imported ModuleTargetName-Swift.h. In my objective-c classes I imported ModuleTargetName-Swift-Fixed.h

This is my class:

// Forward declarations for property classes
#import <StoreKit/StoreKit.h>

// Imports for superclasses
#import "ModuleTargetName-Swift.h"