bridging-header

10x worse Swift performance due to Obj-C bridging in framework?

ぐ巨炮叔叔 提交于 2020-01-24 00:01:10
问题 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 performance about an order of magnitude slower than it should be. About 90% of my cycles are wasted on _ArrayBuffer._checkInoutAndNativeTypeCheckedBounds and bridging-related retains and releases. If I drop the framework and simply include those

How to find path of Bridging-Header.h - Swift, Xcode

ⅰ亾dé卋堺 提交于 2019-12-30 08:30:50
问题 Here I'm attaching a screenshot of created header file I have created a new header file in xcode and named it as (projectname)-Bridging-Header.h. But I am not able to find the path and make it work. How to find the path of the file? 回答1: First go to project build setting, Then search Swift in in the search box After that you will find a Objective C Bridging Header option in Swift Compiler Code Generation Area Add the bridging header path for this Objective C Bridging Header Option Path should

Swift - bridging header compiler error

醉酒当歌 提交于 2019-12-25 01:45:58
问题 I added to my project bridging-header file so I can use opencv in swift. I decided that I don't need opencv so I deleted the bridging header file , after I did it I couldn't run my project because of this error: :0: error: error opening input file '/Users/user1/Desktop/project_name/project_name/project_name-Bridging-Header.h' (No such file or directory) this error appeared in the Compile Swift source files > Precompile bridging header section. I tried cleaning my derived data and I tried

Swift Compiler - General is missing in Xcode 9.1

一曲冷凌霜 提交于 2019-12-24 17:17:56
问题 I was trying give bridging header in target -> Build settings -> Objective C Bridging header I could able to do that using project created using Xcode 9 But I couldn't find Objective C Bridging header in Xcode 9.1 . It is missing in project created in Xcode 9.1 like below. 回答1: Make sure your build setting is selected as "All" and "Combined" look at below image Click on above image for more clear. and just search "bridg" in search bar you will be see Objective C Bridging header . 来源: https:/

“Non-portable path to file ”File.h“; specified path differs in case from file name on disk” warning in bridging header after updating to Xcode 8.3

六眼飞鱼酱① 提交于 2019-12-20 11:35:12
问题 I updated to Xcode 8.3 and Swift 3.1 and got this warning in my bridging header file, referencing to an Objective-C header file: Non-portable path to file "File.h"; specified path differs in case from file name on disk How can I resolve this? 回答1: It turned out that I misspelled the file's name, the correct name was "FILE.h" instead of "File.h". The warning appeared because of the soon coming APFS to macOS. 回答2: In my case, the !!project folder name!! isn't match the bridging header path. I

iOS mixed dynamic framework - bridge objc headers with private module

蓝咒 提交于 2019-12-14 00:22:41
问题 In regards to a "dynamic framework" target, I need to bridge internal (private) objective-c headers to my swift counterparts. From my understanding I need to use a private module. Some of these swift counterparts are bridged back to objective-c using the @objc class TheClass syntax. I've gone ahead and created a module.modulemap and a module.private.modulemap file in a directory under $SRCROOT and added the "necessary" flags to the build settings. SWIFT_INCLUDE_PATHS =>$(SRCROOT)/... I've

I can't import MacPorts' /opt/local/include/ncurses.h into my Swift project. It conflicts with macos SDK /usr/include/ curses.h. Any hint?

吃可爱长大的小学妹 提交于 2019-12-13 21:09:53
问题 EDIT: Getting negatives for such a detailed and HONEST question? Sometimes I don't really get Stack Overflow. Really. Hi, I'm trying to create a PoC using Swift 5 (Xcode 10.2.1) and a modern rendition of ncurses (in this case, MacPorts' one, some 6.1.2018XXXX version) My Poc has no code as of now, as my problems start before being able to add any sensible line to my .swift files. So far I've done the following things: 1.- I have a proper working MacPorts ncurses library installed: that means

Flurry.h not found through bridging header when using cocoapods

主宰稳场 提交于 2019-12-11 13:52:36
问题 In my xcode workspace (using cocoapods), I am not able to add Flurry.h in my bridging header . Other headers from other pods like Dropbox, etc are working fine. Only Flurry headers are not being recognized. I have my podfile as below: platform :ios, '9.0' use_frameworks! pod 'Alamofire', '~> 3.1' pod 'SwiftyDropbox', '~> 2.0.3' pod 'Flurry-iOS-SDK/FlurrySDK' pod 'Flurry-iOS-SDK/FlurryAds' pod 'Parse' My Bridging Header is as below (with the problem highlighted!): Here is the Pods project

Adding Swift Class to Objective-C Project with Multiple Targets

强颜欢笑 提交于 2019-12-11 06:58:28
问题 I have an existing Obj-C project that houses many targets that all share the same AppDelegate. I want to bridge a swift class that is used by select targets. I can do this easily when I have one target. When I add a swift file to the project, I select the desired targets and the necessary bridging-header.h files are generated, but when I try to import those -swift.h files, they are can't be found. Are there steps I'm missing when it comes to projects that have multiple build targets? EDIT -

pod 'GoogleAnalytics' in swift 4 won't run

家住魔仙堡 提交于 2019-12-11 06:05:05
问题 I read this instructions to use google analytics in my app https://developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift so I installed pod 'GoogleAnalytics' into my app and created a .h file in my swift application so here is my h file codes in my app #ifndef analytic_h #define analytic_h #import <Google/Analytics.h> #endif /* analytic_h */ and here is my app Delegate codes But this code does not recognize GAI func application(_ application: UIApplication,