Post

Replies

Boosts

Views

Activity

Swift / Objective C interoperability
I am working on an app in Objective C. I added the the StoreKit framework with the logic using swift. everything worked as planned except for when I wanted to access properties and methods from my ObjC ViewController in the swift code. I did everything as is directed in the apple developer documentation, except it didn't work. I kept receiving the following errors; failed to emit precompiled bridging header ViewController.h file not found ( for the import code in the bridging header) I spent a whole day perusing the internet for a solution. Unfortunately, nothing worked. I thought I should try to import other classes from the ObjC into the bridging header. When I imported 3 files the 3rd one took after commenting out the 2 above it. Then I imported the ViewController again and the build was successful. I deleted every imported file above the file that I need to make visible to the swift compiler leaving the empty lines above it. Apparently, I was getting the errors because my import code was on line 4 instead of line 9, although the file is completely empty except for the comments created by Xcode when the file was automatically created. I am not sure why the placement of the line of code holds that much weight when the file is empty? **Can anyone explain to me any technicality that would lead to this issue? **
1
0
762
Feb ’24
Duplicate a ViewController on Canvas
I was able to duplicate (option + Drag) a ViewController on my canvas the first time, although wasn't easy. The second time, I had so much trouble to get it to work, then finally (option + drag) worked again. I am trying to duplicate the 3rd time and it still is not working. I am able to copy paste the ViewController, the only issue is that I have no visual representation on the canvas, while I do have the duplicate in the document outline and I can do what ever I want to it there, however I prefer seeing a visual rep. on the canvas as well. Is this a bug in Xcode 15 that I am not able to easily (option + drag) a ViewController to duplicate it, like it is done for the UI Objects. On that note it (option + dark) is also a hassle to get it to work the first time even up to the 4 time around on the ViewController itself. Any ideas or info is appreciated.
0
0
532
Jun ’23