Questions tagged [objc-bridging-header]
51 questions
2
votes
1 answer
Cannot assign protocol-conforming Objective-C class to a property with Swift Protocol
I'm trying to have an Objective-C class adopt a protocol written in a Swift file. I've got Swift an Objective-C inter-operating to some extent. (I can construct my Objective-C class from Swift).
I have:
@objc public protocol FooProtocol {
func…

Alex Bollbach
- 4,370
- 9
- 32
- 80
2
votes
1 answer
enum defined in Objc > Declared in Swift > to be used in Objc
I have a situation. I would appreciated if anyone has a solution for this
I have an objC enum say Abc
I declare this in a swift class, say, MySwiftClass.swift as var abc : Abc!
I have created an instance of MySwiftClass (mySwiftClass) in another…

Prabhav
- 969
- 7
- 8
2
votes
1 answer
iTunes Store app validation error when using pod Google/CloudMessaging
I added GCM as google does in their example swift project:
https://github.com/googlesamples/google-services/tree/master/ios/gcm
Library installed via pod 'Google/CloudMessaging'
Added #import in Bridge-Header.h
After…

GeRyCh
- 1,580
- 3
- 13
- 23
2
votes
1 answer
CocoaPods Bridging Header file not found
New developer here, and I'm currently building an app in swift. We are using cocoapods, but after running pod install, we get an error in the objective-c bridging header saying that the file cannot be found, but for any and every file in our…

Michael Eliot
- 831
- 8
- 18
1
vote
0 answers
Invalid preprocessing directive swift
I am getting this error(Invalid preprocessing directive) while importing payTab's (Payment Gateway!)
#ifndef PayTabDemo_Bridging_Header_h
#define PayTabDemo_Bridging_Header_h
#import
#endif

AlbinMrngStar
- 289
- 2
- 13
1
vote
1 answer
Failed to emit precompiled header because Loop condition
Let said I have Swift and Objc classes, and a MyProject-Bridging.h
BazSwiftClass.swift
public class BazSwiftClass: NSObject {
public let foo: String
@objc init(foo: String) {
self.foo = foo
}
}
FooClass.h
#import…

Jefferson Setiawan
- 536
- 1
- 5
- 22
1
vote
1 answer
NS_ENUM object not compile after added in bridging header file
I have one enum which is in constant.h file ( Objective-C )
typedef NS_ENUM (NSInteger, EEFieldType) {
EEFieldTypeHighFields = 1,
EEFieldTypeMediumFields = 2,
EEFieldTypeLowFields = 3
};
I have one bridging file which is connect to swift code…

Priyank Gandhi
- 626
- 2
- 8
- 21
1
vote
1 answer
Objective C bridging header file not found
I have a class name AppState which is using a swift class object
#import "Sonic-Swift.h"
@interface AppState : NSObject
@property (class) NSMutableArray<"Swift class" *> *entity;
Now I need to use this class (AppState) in the swift file. So I'm…

Parv Bhasker
- 1,773
- 1
- 20
- 39
1
vote
2 answers
Unresolved Identifier from #define in imported Objc header file
i have an Obj-c class "constants.h" that looks like this:
// constants.h
#import
@interface constants : NSObject
#define kLookAhead 3600*24*7*4 //seconds*hours*days*weeks
end
In my myProduct-Bridging-Header.h, I…

Sjakelien
- 2,255
- 3
- 25
- 43
1
vote
2 answers
Objective-C Method Parameters in Swift
Having some issues calling a method declared in Objective-C and bridged into Swift. I created a void method right next to the one in question and am able to call it, so I'm pretty certain it has to do with the way the bridging is handling the…

COSMO BAKER
- 337
- 4
- 16
1
vote
0 answers
10x worse Swift performance due to Obj-C bridging in framework?
I'm working on a performance-intensive Swift app, with most of the fast code residing inside a framework. One of my expensive functions involves iterating over a two-million element array of structs. Unfortunately, the Obj-C bridge makes Swift Array…

Archagon
- 2,470
- 2
- 25
- 38
1
vote
0 answers
I am getting this weird error when instantiating Objective C Controller from Swift Code
I have added a group of Objective C classes and one storyboard in the existing swift base project. I also added bridging header file but when I instantiate one of the objective c class from the swift code I am facing this error. I have seen many…

Irfan Ahmed
- 43
- 7
1
vote
0 answers
Steps to integrate Swift Framework into Objective C Project?
I have an Objective C Project and I need a scrollable tab. So I came cross the below framework scrollableTab
Its a swift framework and I added it using cocoa pods.
I could add @import SlidingContainerViewController;
but I was not able to access…

j.krissa
- 223
- 5
- 21
1
vote
1 answer
Using Objective-C Enum in Swift
I'm calling an Objective-C method in my swift 2.3 code in Xcode 8.2 (build target 8.0). It accepts an NS_ENUM as a parameter:
typedef NS_ENUM(NSUInteger, MLCMultipleChoiceSlideSubtype) {
MLCMultipleChoiceSlideSubtypeQA,
…

ASchuerholz
- 21
- 3
1
vote
0 answers
How can I integrate quickblox framework with objective c headers files, in my swift project?
I am integrating Quickblox Framework for chat feature into my own app in Xcode 8.2 using Swift 3.0.
But while importing header files of Quickblox Framework in bridging header file, its giving errors
Has anyone done this kind of integration of…

hitesh
- 11
- 2