Swift’s compatibility with C and Objective-C lets you create a project that contains files written in either language.
Questions tagged [objective-c-swift-bridge]
117 questions
1
vote
2 answers
How to import swift file to objective-c class, for class delegation?
I’m developing my with swift, Now few of my older files are written in objective-c. So I create bridge for class communication.
One of my delegate class is written in objective-c, Now I want to know which is the current class which invokes my…

Ashwin Kanjariya
- 1,019
- 2
- 10
- 22
1
vote
1 answer
Cannot access Swift vars from objective-c, Xcode 8
I have looked at a lot of posts on this topic, and I still can't see what I am doing wrong. I have a view controller in objective-c that is trying to access an NSObject code snippet in Swift. I have Debugs Module YES and both the objective-c…

Nelson Capes
- 411
- 3
- 12
1
vote
0 answers
Accessing an externed variable from objective-c in swift
I have an iOS project that uses both Obj-C and Swift.
In main.m, I want to instantiate a variable to be accessed by Swift. The specific use case is to store the absolute time at main, and then measure time elapsed since main elsewhere.
Here's what…

leonsas
- 4,718
- 6
- 43
- 70
1
vote
0 answers
Could not build module 'NUI': 'NUIParse/NUIParse.h' file not found
There is a problem with importing the NUI pod inside Swift-Bridging-Header.h. NUI module can't be built because of a missing dependency .
I even tried adding NUIParse into the Podfile, but it didn't
help.
pod install doesn't…

Peter G.
- 7,816
- 20
- 80
- 154
1
vote
0 answers
Undefined symbols for architecture x86_64 Slide Tab View
Background:
Using DLSlideView for Slide Tab view in an iOS Swift App.
Project Language selected = Swift
Xcode Version = 8.1
Bridge Header = created
Running platform = Simulator
Paths of the import files all set.
Path is set for the bridging…

muttahir
- 115
- 10
1
vote
1 answer
Swift to Objective C header file not found
I have this issue on the latest Xcode 8.0 where when I attempt to #import "xxx-Swift.h" in my Objective C implementation I get an error in my code editor of "file not found". The project builds and debugs fine, but I cannot seem to get rid of this…

Christo Smal
- 615
- 5
- 16
1
vote
0 answers
objc NSData vs. Swift Data when bridging failing
I’m not so sure this is a dumb newbie question so I kept that out of the subject line ;-) My app has a few objC frameworks that are being bridged in via the bridging header. One issue I’m seeing at runtime has to do with the objC NSData object…

Bob
- 11
- 4
1
vote
1 answer
WhirlyMaply missing MaplyBridge.h
I am trying to use WhirlyMaply for a personal project.
Am trying to follow their tutorial and they mention I have to have a bridge file since the code is written in Objective-C and I am writing my project in Swift.
However there is no…

Marin
- 12,531
- 17
- 56
- 80
1
vote
1 answer
Error message 'Expected ; after top level declarator ' 'Unknown type name import' with the bridge to use Swift in Objective-C
I Have a message error when I try to add a bridge to use Swift in Objective-C.
Here is my code :
import UIKit
@objc class ScanViewController : UIViewController, IRLScannerViewControllerDelegate
{
var scan: Int = 0…

ΩlostA
- 2,501
- 5
- 27
- 63
1
vote
1 answer
NS_ENUM in Swift
NOTE: This is not a dupe of this question.
I am trying to use a library named GBCli in Swift. It was written in Objective-C. I am having trouble with a particular enum:
/** Various command line argument value requirements. */
typedef…

Coder-256
- 5,212
- 2
- 23
- 51
1
vote
0 answers
How does compiler behaves when swift and objective c is used in the same project?
Swift does more of the work in compile time like memory allocation for properties and Objective C does same work in run time.
Swift uses optimize compiler . If there is mix and match i.e. same project with swift code and objective c the which…

hari_krishna_bista
- 11
- 1
1
vote
1 answer
swift: json output using restkit
I am trying output my json from RestKit to the console. I read that
RKLogConfigureByName("RestKit/ObjectMapping", RKLogLevelDebug);
is the way to do it. However, it seems swift isn't happy with that. I came across this blog…

JordanA.
- 11
- 2
0
votes
0 answers
Extend ObjC class with Swift extension Causes crashes when released to Appstore
I have an objective project and when I'm extending the project to Swift, It works fine when locally testing it and also when testing it over testflight.
But after submitting the app to the appstore and when users download it and use, I see crash…
0
votes
1 answer
How to design protocols that can be applied to both Swift value types and Objective-C NSObject subclasses in Swift?
I'm defining a protocol in Swift language, and this protocol will be used in both Objective-C and Swift projects.
Its first version is as follows:
public protocol DataCodable {
func encode() -> Data?
func decode(from data: Data) ->…

P. Tsin
- 435
- 4
- 14
0
votes
1 answer
Objective-C and Swift, using assistant editor. Nullability
I am currently following Paul Hudson's book Objective-C for Swift developers.
In a book, in chapter Nullability, I create a class:
#import
NS_ASSUME_NONNULL_BEGIN
@interface PersonNullabilityCheck : NSObject @property…

Jakub Gawecki
- 801
- 2
- 6
- 14