Module error when detecting an error when entering a Swift project into an Objective-C project

I have an existing project written in Objective-C. I want to use the Daniel Gindi iOS Charts library , which is located in Swift, in this project. How can I achieve this?

importing the quick structure into the objective-c project is related, but in my case I use the library, installing it through Cocoapods , as indicated here .

In this question, at least he can import the title, but in my case I cannot.

Step 1: Create an objective-c project for a single view.

Step 2: Create a subfile and add the following lines -

use_frameworks! pod 'Charts' 

Step 3: Install the pod

Step 4: try importing charts into ViewController.h using @import Charts , but an error occurs. Error - Module Charts not found

+8
objective-c swift ios-frameworks ios-charts ios-library
source share
3 answers

In my existing project, I made #include Charts-Swift.h in the main.m project main.m , and I solved this problem. @import Charts worked @import Charts fine. This was done in accordance with the instructions that are written in the Apple documentation here.

I made a new project and tried Anni S answer , this time I created a project with cmd+B before writing any import statement, and it worked too. I assume that he built it once after installing the container and before importing any module.

+10
source share

I tried the same step that you mentioned in the comment, but I did not get the error you received. My project just builds and runs. The steps that I followed:

  • Create a project with a single Objective-C project view.
  • Added "Subfile" at the project directory level (the subfile should be at the xcodeproject file level) and add the following lines
 use_frameworks! pod 'Charts' 
  1. Close xcodeproject
  2. Go to the project directory and run the command 'pod install' from the terminal
  3. Open the workspace, i.e. .xcworkspace file
  4. Import diagram files into a view controller, for example

#import "ViewController.h" @import Charts;

+3
source share

I found the reason why it works for a new project, but for an existing project.

In the project settings, delete the value of the Other Flanger Flags property.

In most cases, most developers are left out.

0
source share

All Articles