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
0
votes
1 answer
Swift error: Cannot convert value of type '() throws -> ()' to specified type 'Bool'
I have a function in Objective C that returns a BOOL and has a single errorOut parameter. The swift bridge converts the errorOut parameter into a throws as expected but it also stops the BOOL being returned.
I can see that usually the BOOL is…

Inti
- 3,443
- 1
- 29
- 34
0
votes
1 answer
Determinant Progress Indicator
I’m trying to create a window that displays a determinant progress indicator. This indicator would start loading and once done, fade into the background... revealing the regular macOS storyboard template. I’m not asking for someone to write this…

Forrest Ager
- 1
- 1
0
votes
0 answers
Bridging objective-c NSUInteger NS_ENUM in Swift 3
I am attempting to bridge an objective-c SDK to a swift implementation. I have an example of what the implementation would be in objective-c but don't seem to be able to implement this in a workable solution in swift. Enum in objective-c header file…

fantasymyway
- 1
- 1
0
votes
0 answers
Where can I find objective c temp files for swift
All the swift files that are available for Objective C and can be found in swiftfilename-swift.h file.
Here we can see all the function declarations for swift methods.
I want to see the same for Objective-c functions, i.e. A swift file which list…

Dan Ram
- 171
- 1
- 14
0
votes
0 answers
Integrate FairPlay Streaming Server SDK (it is in swift) into my existing objective c code using Xcode 8.2.1
i try to integrate FairPlay Streaming Server SDK (it is in swift) into my existing objective c code.using Xcode 8.2.1 project in MAC OSX 10.12.3 system.The FairPlay Streaming Server SDK consists of swift classes that can be imported into objective…

srikanth
- 1
- 1
0
votes
2 answers
how do i merge my swift code into existing objective c project by the use of bridge file
i merge my swift classes in objective c existing project with the use of bridge.h file after than am not able to import my swift classes into my bridge.h files

srikanth
- 1
- 1
0
votes
1 answer
Apple API fsckup: how do I make unsafepointerof 0 a.k.a. NULL / 0x0 in swift?
I have a case when parameter should have been UIViewController!
to map from objc properly, but it is, sadly, UIViewController.
This
func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController currentVC:…

Anton Tropashko
- 5,486
- 5
- 41
- 66
0
votes
2 answers
'Property not found on object of type' when creating Objective C to Swift Bridge
I'm getting an error stating: Property 'clientChatLoad' not found on object of type 'DataManager' when using the following implementation:
AppDelegate.m
#import "IOS_Project_Name-Swift.h"
@class DataManager;
...
…

Droidthusiast
- 61
- 8
0
votes
1 answer
Swift & Salesforce SDK, using SFRestDictionaryResponseBlock
I've been attempting to create a delete request to remove a specific record from my custom objects using SFRestAPI. The code I've written so far is;
let deleteRequest = SFRestAPI.sharedInstance().performDelete(withObjectType: "Event__c", objectId:…

Matqo
- 1
- 2
0
votes
1 answer
Cannot convert value of type 'NSArray' to expected argument type '[Any]!'
I have added an Objective-C category to my Swift 3.0 code. It has a method with header:
+(UIBezierPath *)interpolateCGPointsWithHermite:(NSArray *)pointsAsNSValues closed:(BOOL)closed;
When I call it from my Swift code:
antiAliasing =…

Amani Elsaed
- 1,558
- 2
- 21
- 36
0
votes
0 answers
"file not found" Error in objective c to swift bridging header
I have placed the .framework at the target level (outside the swift project folder). I gave the #import path in bridging file as (framework)/.h(file) which seems correct, but I have the same error. I've already tried all possibilities. I may be …

Pranav Rivankar
- 19
- 5
0
votes
2 answers
How to Represent Dictionary as NSValue in Swift 3?
I have the following Dictionary:
let example: [String: (Int, Int)] = ["test": (0, 1)]
I need to store this as an NSData variable, and to do that it must first be converted to an NSValue, which I try to do as follows:
let nsval =…

Brandon Bradley
- 3,160
- 4
- 22
- 39
0
votes
1 answer
Bridging swift code into obj c project
I added the swift bridge and changed the proper settings to allow swift in the objc project. But my big issue is that the swift3 code that I am trying to bridge is coming up all errors in my project as it shows it has no members, no types etc..…

codeNinjaBro
- 78
- 10
0
votes
1 answer
Passing string from Swift to C back to Swift
I'm seeing some behavior I don't understand when passing strings between Swift and C. Consider the following Swift function:
func demo()
{
print("\n\n\n\n") // Line A
let str =…

Philip
- 1,526
- 1
- 14
- 25
0
votes
1 answer
React-Native: Background app refresh while app closed
I need to update app's database every 30 or 60 minutes. After lots of search i've found this module :
https://github.com/transistorsoft/react-native-background-fetch
As it says in its page:
iOS Background Fetch is basically an API which wakes up…

Ata Mohammadi
- 3,430
- 6
- 41
- 69