Questions tagged [bridging-header]

Special header that facilitates cross-language developments between Swift, Objective-C, Objective C++, C and C++ on MacOS and iOS. Use exclusively cross-language development.

The bridging header is a special header in MacOS and iOS projects that aims at facilitating multi-language development by sharing definitions that are common between Swift and Objective C code.

In view of the (limited) interoperability between Objective-C and other programming languages, the bridging header also facilitates Objective-C++, C and C++ interoperability.

External references:

350 questions
3
votes
1 answer

How to Integrate Swift CocoaPods with a bridging header file

I've recently started doing iOS and I'm attempting to integrate the Vitamio Objective-C library with my Swift Project. I use CocoaPods to import various swift libraries. Vitamio is integrated with a bridging-header file. Bridging-Header…
Adam W
  • 972
  • 9
  • 18
3
votes
0 answers

Can't use pop in Xcode 8

I'm using Xcode 8 and both Swift and Objective-C in my code. Recently, I updated my Xcode from 7.3.1 to 8 and converted Swift syntax to Swift 3. Then I got this error: 'pop/POP.h' file not found. failed to import bridging header also some problem…
Hongxu Jin
  • 817
  • 2
  • 9
  • 16
3
votes
2 answers

Unable to get correct file path from bridge header when project name has a space

I have created a manual bridging-header using these these instructions. However, my project name has a space in it. I get the following error when compiling: Bridging header '/Word-Word/Word-Word-Bridging-Header.h' does not exist Here is what I…
Pranav Wadhwa
  • 7,666
  • 6
  • 39
  • 61
3
votes
1 answer

Objective-C protocol in Swift

I am using Fusuma cocoal pod framework. However, I found that they have an Objective-C protocol even thought the whole project was written in Swift. @objc public protocol FusumaDelegate: class { func fusumaImageSelected(image: UIImage) …
user172902
  • 3,541
  • 9
  • 32
  • 75
3
votes
0 answers

imported xcode generated swift header not found in .pch file

I have recently added a Swift file to my Objective-C only project. Xcode created the necessary header files, including the Objective-C Generated Interface Header. Everything works fine if I #import this header file "myProject-Swift.h" to the .m file…
Dana
  • 435
  • 1
  • 4
  • 13
3
votes
2 answers

Automatically generated Swift-Header broken in Xcode 8

When I try to build my app with Xcode 8 beta (after converting my Swift 2.2 to Swift 3 using the built-in tool), the automatically generated Swift header (TargetName-Swift.h) has some errors. There are 3 different errors occurring at multiple…
FelixSFD
  • 6,052
  • 10
  • 43
  • 117
3
votes
1 answer

XCode 7.3 broke Bridging-Header.h?

I just upgraded to XCode 7.3 and it seems to have broken my PROJECT_NAME-Bridging-Header.h I am receiving this error: BBCategoryType is an enum defined inside a file called BBCategory.h, and that file is imported within my…
etayluz
  • 15,920
  • 23
  • 106
  • 151
3
votes
1 answer

"Error failed to import bridging header" when installing the app on device while working fine for simulator

I'm very new to iOS and I'm coming from the Android background. I've read many post about this issue but I'm unable to resolve this issue. My problem is that the app runs fine on the iPhone simulator but while running on the device it gives me…
Rahul Chaurasia
  • 1,601
  • 2
  • 18
  • 37
3
votes
1 answer

How to change Swift header("ProductModuleName-Swift.h") Product name as product name changes dynamically

I am including the swift class inside objective-c class using the header #import "ProductModuleName-Swift.h", where ProductModuleName is my application product name, hence it works fine!. But the problem is, in my project i have an automation which…
kee
  • 189
  • 6
3
votes
3 answers

Swift - Importing Objective-C Gives "Unknown type name"

I'm working on a swift project until i needed This "Analog Type Time Picker". I downloaded the repo and tried it using Xcode 6.4 and it works fine. But when I started to transfer it to my project, It ask me to create a Bridging-Header and I created…
LEVIS OGCPAS
  • 229
  • 4
  • 11
3
votes
3 answers

Using UIActivityIndicator-for-SDWebImage with Swift

I'm using SDWebImage and I would like to add a loading indicator. I found the UIActivityIndicator-for-SDWebImage library, and I have tried to add it to my Swift project by adding this: #import "UIImageView+UIActivityIndicatorForSDWebImage.h" to my…
user3746428
  • 11,047
  • 20
  • 81
  • 137
3
votes
3 answers

Why do I keep getting this error for my bridging Header in Xcode 7: Bridging Header does not exsist?

I updated my Xcode to version 7 and now I get this error saying the bridging header doesnt exist. It tells me that its supposed to be in the /users/desktop/apps/projectname/projectname-bridging-header.h. I checked in the file and its there but xcode…
coding22
  • 689
  • 1
  • 7
  • 28
3
votes
4 answers

Cannot find interface declaration for 'UIView' in iOS Swift Project

I have a swift project which I'm making use of MBProgressHUD in through a Bridging header file. The issue I'm having is that UIView doesn't appear to be recognised as type and I don't know why. In my bridging header I have: #import…
user843337
2
votes
2 answers

Import headers from c++ library in swift

I am learning how to communicate between swift and c++ for ios. As a first step I have looked on this example: https://github.com/leetal/ios-cmake There is an example-app that I have managed to compile and run. Took some time to get it to work. That…
El_Loco
  • 1,716
  • 4
  • 20
  • 35
2
votes
1 answer

Redefinition of 'ClassName' as different kind of symbol in generated header

I created a Swift enum as an Int (so it will work with Objective-c). When I build the project, everything is fine. However, as soon as I try to import the class in a .h file (using a forward declaration @ClassName), the generated header file errors…
Aggressor
  • 13,323
  • 24
  • 103
  • 182