I am trying to centralize my frequently used Swift code into the framework, and part of this code uses Google Analytics. I cited Google Analytics as Cocoapod, but I canβt access it from the new structure, as I did from the original project, because it is Objective-C and there is no support for bridge headers in frameworks [I use Swift 1.2].
The line of code that I usually have in the header of the bridge that does all this work:
#import <Google / Analytics.h>
Where exactly do I put this in my project to do it all the way it was done earlier in the header of the bridge?
What I found in the Apple Documentation about mixing Swift and Objective-C is this:
Import code from within the same framework Purpose
If you are writing a structure in a mixed language, you may need to access your Objective-C code from Swift and your Swift code from Objective-C.
Import Objective-C into Swift
To import a set of Objective-C files into your same Swift code, you will need to import these files into the Objective-C header header for the frame.
To import Objective-C code into Swift from the same structure
In the "Assembly Settings" section of the "Packaging" section, make sure the "Define" module for this target frame is set to Yes. In your umbrella header file, import each Objective-C header that you want to Swift. For example: Objective-C
import <XYZ / XYZCustomCell.h>
import <XYZ / XYZCustomView.h>
import <XYZ / XYZCustomViewController.h>
The phrase that I find most relevant is:
you need to import these files into the Objective-C probe header for the frame
But what is this file and how to create it?
Apple's documentation is mentioned earlier (in the table):
Objective-C code
Import to Swift
#import "Header.h"
Well, I tried just creating the "Header.h" file and importing it, but that doesn't work. I do not know what they are trying to say. I can not find the "umbrella" in the build settings.
So my question is how to import this file (#import <Google / Analytics.h>) into my Swift project so that it can see the structure of the coco-hood of Google Analytics, as I would normally do in a bridge header a regular project?
Update:
I came to the conclusion that perhaps the title of the Objective-C bridge is an .h file with the same name as the project. I now tried adding the import statement there, and I get a message:
! Include a non-modular header inside the 'JBS' frame module