Expected a type & Failed to import bridging header
Asked Answered
T

2

6

I'm working on a project that contains Swift and Objective_C code, it works without any problem until i was trying to import a ".h" class in my "Bridging-Header" file:

  • Expected a type : in the class that i was trying to import it
  • Failed to import bridging header '/Users/sysadmin/Desktop/Application /Classes/UI/Application-Bridging-Header.h'

however when i have imported an other class in Bridging Header that works without problem!

Tervalent answered 26/5, 2017 at 10:47 Comment(0)
T
0

There is 3 ways to import objective c file in Swift project.

  1. #import "FileName.h"
  2. #import <FolderName/FileName.h>
  3. @import PackageName; like @import Alamofire;
Transliterate answered 26/5, 2017 at 11:58 Comment(1)
Welcome Bro. if My solution is work for you then mark Green so else user get guid.Transliterate
T
0

Try importing your class like

#import "classname.h" if this fails try
#import `<classname/classname.h>`

Remember to clean and then run after you make a change. Again if it fails check whether you have added the class to your target

Trivium answered 26/5, 2017 at 11:46 Comment(0)
T
0

There is 3 ways to import objective c file in Swift project.

  1. #import "FileName.h"
  2. #import <FolderName/FileName.h>
  3. @import PackageName; like @import Alamofire;
Transliterate answered 26/5, 2017 at 11:58 Comment(1)
Welcome Bro. if My solution is work for you then mark Green so else user get guid.Transliterate

© 2022 - 2024 — McMap. All rights reserved.