In my IOS Project, when i try to remove Bridging Header file cause error?

1.6k Views Asked by At

To setup a SideMenu in my iOS project, I'm Using SWRevealViewController without pods and this create a bridging header file

SWRevealViewController.h
SWRevealViewController.m
MyProjectName-Bridging-Header.h

Now I want to remove these three files and add my custom SideMenu, but this cause a big problem I trying some solutions which I found in stackoverflow and another websites like
1. go to Target > Build Settings > Swift Compiler - General > Objective-c Bridging Header and remove its value. but this case a lot of errors.
2. retrive just this file 'MyProjectName-Bridging-Header.h' but this again cause a lot of errors.
the project does not work successfully without the three file. although i don't use these three file in any part of my project.
when I delete the three files + clean the Objective-c Bridging Header I get this error.
enter image description here


Edit: I note that after I do the deletion step the 'import UIKit' disappears from most files in the project.

2

There are 2 best solutions below

1
Ahmed Eid On BEST ANSWER

I solve the problem by the following steps
1- Delete these two files which caused in creating bridge file

SWRevealViewController.h
SWRevealViewController.m

2- remove #import "SWRevealViewController.h" from Bridging file
and add #import <UIKit/UIKit.h>

enter image description here


and this solve the problem for me.

1
Manoj On

Are these only 3 OBJ-C files you use in your project?

Here are the steps you should follow: 1. Delete all the {{obj-c}}.h,.m,.xib along with AppName-Bridging-Header.h

enter image description here

  1. Then go to Target > Build Settings > Swift Compiler - General > Objective-c Bridging Header and remove its value, as you saw in multiple stack overflow post.

enter image description here

Clean build and run the project to solve the errors