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
0
votes
1 answer

Bridging header in framework method accessibility

I have a framework written in Swift and some Objective-C files. I need the Objective-C methods only in the Swift classes of my framework. When I add the corresponding import into the bridging header, it makes the methods available outside the…
yageek
  • 4,115
  • 3
  • 30
  • 48
0
votes
0 answers

Using C++ in swift using a Objective-C Wrapper

I want to build a little project that utilizes the QR Encoder. I simply used Cocoapods to install it within my project and included the QREncoder.h file within my bridging-header, which works just fine for a couple of other Objective-C resources. My…
Geru
  • 624
  • 1
  • 7
  • 20
0
votes
0 answers

How to get Objective C class by passing Swift calls to Objective C function

I have library developed in Objective C. In that library, one of my property expects the registration of my class. So that it will call the pre-defined method on that class. (Some what like delegate). Below is my objective C property and how I set…
DShah
  • 9,768
  • 11
  • 71
  • 127
0
votes
1 answer

Objective-C Swift bridging header

After successfully using my Xcode created Objective-C bridging header Xcode now returns a Swift Compiler error complaining that the bridging header does not exist. I had been able to use the Xcode created bridging header all day yesterday before…
0
votes
1 answer

Obj C bridging header does not seem to matter?

I have a Swift / Parse iPhone project in Xcode. I have added Parse frameworks and as long as I import Bolts and import Parse in my swift file I am able to use all parse functions. I am now wondering, why do I need the Obj C bridging header at all?…
Kashif
  • 4,642
  • 7
  • 44
  • 97
0
votes
2 answers

# Imported Obj-C class through automatically created Bridging header, Bridging header seems to find it but Swift class won't

I added the files directly to my project from finder to Xcode. Bridging header was automatically created by Xcode. #import the Class into the Bridging header - no issues on the Bridging Header. I try to instantiate Class var into swift class - "use…
moyoteg
  • 351
  • 3
  • 11
0
votes
3 answers

Swift: CorePlot-CocoaTouch.h file not found when importing through Bridging-Header file

I'm iOS beginner, so I'm sorry if this is an elementary mistake... Hi, I'm developing iOS app by Swift, and trying to use CorePlot( https://github.com/core-plot/core-plot ) Library. Using examples from this blog (…
nsmkw
  • 1
  • 2
0
votes
1 answer

Bridging Header Issues

I'm trying to add a Swift file to my app and get a "Failed to import bridging header" error, among others. Bridging-Header code: // // Use this file to import your target's public headers that you would like to expose to Swift. // #import…
raginggoat
  • 3,570
  • 10
  • 48
  • 108
0
votes
1 answer

Bridging header conversion in Swift

How I can convert this Objective-C format into Swift? I already create a bridging header called Bridging-Header.h. I already import this library header into bridging header. #import "DraggableView.h" #import "DraggableViewBackground.h" #import…
Nurdin
  • 23,382
  • 43
  • 130
  • 308
0
votes
1 answer

swift zeromq c bridging header - cannot find types

I'm trying to build Swift bindings for zeromq using czmq. I've configured a bridging header in xcode and it seems to understand that, but I still get this error: /Users/jjl/code/swiftzmq/src/zsock.swift:47:37: error: use of undeclared type…
jjl
  • 173
  • 6
-1
votes
1 answer

Converting UnsafeMutablePointer to an Array gives wrong value

I'm using Swift and should I use C source with Bridging-Header. C source has like this function. char* testFunc2(char *input) { // input = [4, 5, 6, 7, 8, 9] char v1[17] = { 0, }; memcpy(v1, input, 4); return (char*)v1; } The v1's…
오영택
  • 7
  • 1
  • 8
-1
votes
1 answer

Bridging header in objective C - Unexpected '@' in program

I'm trying to use some of my swift classes inside of my Objective C project. Before to do it, I have validated the ios versions.ç I'm using Can't use Swift classes inside Objective-C but, at the moment to update the MyProject-Bridging-Header.h…
JESERRANO
  • 359
  • 1
  • 3
  • 8
-1
votes
1 answer

bridging header problem compiling project on Mac mini despite compiling and running perfectly on macBookPro

I am running this project on my MBP and works fine , upon pulling from the repo or even copying the entire project to my Mac mini the errors in the image happen . I am sure it works (verified adding the bridging header correctly and setting the…
-1
votes
1 answer

Xcode : Bridging header not recognising imports

I have a project contains objective C code and I want to implement new features using Swift so I created Bridging header and added it to the build paths, the problem now is when I add #import "xx" to the Bridging header #import is not recognized and…
-1
votes
1 answer

Use of undeclared identifier 'EventToSend'

I'm developing my first MacOS application where I'm linking Objective-C with Swift, I still got a lot to learn. I think that I have everything declared and linked, but for some reason the compiler prompts this error. Use of undeclared identifier…
xedge
  • 3
  • 5
1 2 3
23
24