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

Using Swift class in Objective C class with swift project

My project is a Swift project, which contains custom class in Objective C. Now I'm trying to use an another custom class which is in Swift in my Objective C class. I'm able to get the class, but all it's methods are not accessible. Project :…
Ankita Shah
  • 2,178
  • 3
  • 25
  • 42
0
votes
1 answer

How to append a new String element to an array in Swift, from C

I have an array of Strings in Swift declared like this: var DataStreamBuffer : [String] = {return []}() Appending a new element in Swift, it's easy. I just do: DataStreamBuffer.append(new_string) However, I need to append a new element to…
Duarte
  • 127
  • 4
  • 14
0
votes
0 answers

Creating NSManagedObject in Swift from ObjectiveC

I have an app with CoreData written in obj-c and created a new VC in Swift. I want to create a new "Location" in my swift VC and "Location" is a managedObject in obj-c. I have Location.h in my bridging header. let newLocation =…
julien
  • 437
  • 4
  • 9
0
votes
1 answer

How to recover if Bridging Header deleted out of Build Settings?

In my swift project, I accidentally removed my reference to the bridging header out of the section in "Build Settings" for the project. Now, Xcode can't find the file (even though I see it in my project navigator). What can I do to resolve this?…
OOProg
  • 189
  • 1
  • 5
  • 16
0
votes
1 answer

How to import Objective-C file to bridging header if it contains an import of Project-Swift.h

So, problem goes as is. I have a file that contains: #import "Project-Swift.h" And I want to add this file to my BridgingHeader. So when I try to compile it, the error is as follows: 'Project/Project-Swift.h' file not found #import…
Vivienne Fosh
  • 1,751
  • 17
  • 24
0
votes
2 answers

GoogleMaps not found

I am trying to use google maps in my ios app my Xcode ver is 7.2 and swift ver is 2.1.1. I simply add GoogleMaps in my pod file everything is fine i added frameworks and libs which are required to support Googlemaps all fine, i am following this tut…
MQ.
  • 365
  • 6
  • 28
0
votes
1 answer

XCode Errors on bridged AWS SDK

I'm pretty new to iOS and 100% new to AWS. I'm building an app that needs to upload files. I downloaded the Amazon SDK through CocoaPods and used a bridging header to work with it in Swift. Here's my header: #ifndef ObjC_Bridging_Header_h #define…
Isaac Wasserman
  • 1,461
  • 4
  • 19
  • 39
0
votes
1 answer

When updating, is it possible to program an app to delete everything about itself then install the newer version?

I had an obj-c project which I later converted to Swift. When the users of the obj-c app try to update it to the Swift version, the screen turns blank and the app gets terminated. However, when the app is uninstalled first and then newer version is…
0
votes
1 answer

Bridging header issues, Missing header files when run on device

I have following lines on my Bridging-Header.h // // Use this file to import your target's public headers that you would like to expose to Swift. // #import "FMDB.h" #import "UAProgressView.h" #import "ASValuePopUpView.h" #import…
Mr.KLD
  • 2,632
  • 2
  • 16
  • 26
0
votes
0 answers

Unable to access objc class in Swift

I work on a project that was developed by other person, so I don't exactly know how he proceed. Anyway... I have to had a new fonctionnality in Swift in Objc based project. So I add bridging header. All project work, except for one thing. I have…
MaxL
  • 1
0
votes
4 answers

C code in Swift Project

I have a C program, that I would like to print its output from swift, and when it scans I can give it input through Swift. Is such thing possible? I tried this with a simple function, and it worked, but how can someone do so with many different…
MasterWizard
  • 857
  • 2
  • 15
  • 44
0
votes
2 answers

Import ViewController.swift in Objective C file

I'm trying to use my new ViewController.swift file in my existing objective C project. Below is swift file code import UIKit class TutorialViewController: UIViewController{ } Below is Objective C code #import "TutorialViewController-Swift.h" …
Ankita Shah
  • 2,178
  • 3
  • 25
  • 42
0
votes
2 answers

Bridging an ObjC project with the SalesForce SDK causes a crash due to inability to find a category in the SF SDK

I have an iOS project called Core.proj that includes the SalesForce SDK and it is written in Objective-C. This project utilises the SF SDK and links the binary to the SF libraries. It does a bunch of stuff to help manage my implementation of SF. It…
nilsfrahm
  • 1
  • 1
0
votes
1 answer

Bridging header file Swift

I want to manually create a Obj-C bridging header file for my new Swift project for use with AudioKit. I am stuck. Everything seems to be correct (I even checked whether a space at the end of the file path was the problem and it isn't, and I cleared…
Kacper Cz
  • 504
  • 3
  • 17
0
votes
1 answer

Objective-C protocol method invisible in Swift

I'm currently working on some Swift classes in my ObjC project. The problem I have is the following: I have this protocol declared in ClassA.h: @protocol MyProtocol - (void)complexMethodWithArg1:(id)arg1 arg2:(id)arg2 arg3:(id)arg3; …
Champoul
  • 1,004
  • 7
  • 15