问题标签 [bridging-header]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
8 回答
116668 浏览

ios - Xcode not automatically creating bridging header?

I imported an Obj-C file into my swift project and Xcode automatically prompted me to create a bridging header file as expected. However, I deleted both the files (moved to trash) to make some changes, but when i try to import the Obj-C file once again, the prompt doesn't come up anymore. What is the reason? I even tested this same scenario in another project, It seems once I delete Xcode's auto created bridging header, It won't bring the prompt up again another time. Why is this?

0 投票
4 回答
1123 浏览

ios - ADAL iOS 与 CocoaPods v0.38 使用 Swift 没有桥接头

我正在构建一个使用 ADAL 连接到 Office365 的 Swift 应用程序。几个月前,在 Podfile 中,我只有一行:

当我定义一个包含以下内容的桥接头时,一切正常:

最后,在我的 Swift 代码中,我只需要添加

但我也想开始使用 SwiftyJSON,它是一个 Swift 框架,所以我在 Podfile 中添加了几行代码:

更新到 CocoaPods V0.38 允许使用带有 Objective-C 库 (ADALiOS) 的框架。根据文档,不再需要桥接头,所以我删除了它。

现在,一切编译正常,但是当我调用 ADAL 代码时,它失败并出现以下错误:

我假设因为它可以很好地编译/链接,所以这与桥接头无关,而是与其他东西有关。

有什么线索吗?

0 投票
5 回答
4322 浏览

ios - 桥接头问题 - “MyClass”不可用:找不到此类的 Swift 声明

我访问过这个链接 -

MyClass 不可用:找不到此类的 Swift 声明 - 仅发布构建

添加链接或嵌入式 Swift 框架:“MyClass”不可用:找不到此类的 Swift 声明

Swift:使用私有框架

但是以上链接都没有帮助我解决我的问题。

我正在使用objective-c开发一个应用程序,在应用程序中我正在集成ios-charts,其框架是用swift开发的。我已经合并了README文件中给出的项目。集成后,我创建了一个 MyClass.swift 文件,然后继承了 MyClass.swift 文件,其中定义了一个 Class charts.framework。但是这是一个错误

“类”不可用:找不到此类的 Swift 声明

有没有人帮我解决这个错误?有什么建议么??

0 投票
1 回答
25009 浏览

c++ - Can I have Swift, Objective-C, C and C++ files in the same Xcode project?

Can all 4 languages be used in the same project at all, and if so how?

There are similar questions in the flavor: Can I mix Swift with C++? Like the Objective - C .mm files to which the accepted answer is no.

Using Bridging Header adequately, .h that do not contain C++ statements, Objective-C wrappers when .h do contain C++, .mm files to do the actual wrapping of C++ classes, and .swift, can the 4 languages (5 if you include Objective-C++) build and link into a single executable?


0 投票
4 回答
2832 浏览

swift - 在 iOS Swift 项目中找不到“UIView”的接口声明

我有一个swift项目,我正在MBProgressHUD通过桥接头文件使用它。我遇到的问题是UIView似乎没有被识别为类型,我不知道为什么。

在我的桥接头中,我有:

我尝试构建时遇到的错误都是相同的:

我检查了 MBProgressHUD 文件,我可以看到它确实导入了以下内容:

有没有其他人看到过类似的问题?如果是这样,您知道问题是什么,我该如何解决?

0 投票
3 回答
166 浏览

ios - 为什么我在 Xcode 7 中的桥接标头不断收到此错误:桥接标头不存在?

我将我的 Xcode 更新到版本 7,现在我收到这个错误,说桥接头不存在。它告诉我它应该在 /users/desktop/apps/projectname/projectname-bridging-header.h 中。我签入了文件,但 xcode 仍然给我一个错误。有没有人以前遇到过这个问题并且知道如何解决它。谢谢!

0 投票
1 回答
645 浏览

ios - ATLAddressBarViewController.h not found in Atlas.h

I am trying to run https://github.com/kwkhaw/quick-start-ios-swift this project. But facing this error while compiling the code. Following is the image description for the same.

0 投票
1 回答
737 浏览

ios - 无法使用 CocoaPods 添加 Parse

以下是我添加Parse使用CocoaPods但仍然出现未解决错误的步骤。

添加了 Pod 文件:

之后我做到了pod install。Parse 和 Bolts 框架已安装(我可以在 XCode 中看到它们)。

然后我添加了 -Bridging-Header.h 并添加#import <Parse/Parse.h>到它。

在此处输入图像描述

当我尝试import Parse输入AppDelegate.swift文件时,我仍然收到No such Module Parse错误消息。我在这里想念什么。

在此处输入图像描述

我也确实使用该*.xcworkspace文件打开了项目。

0 投票
3 回答
1365 浏览

ios - 在 Swift 中使用 UIActivityIndi​​cator-for-SDWebImage

我正在使用SDWebImage,我想添加一个加载指示器。我找到了该UIActivityIndicator-for-SDWebImage库,并尝试通过添加以下内容将其添加到我的 Swift 项目中:

到我的桥接头。usingActivityIndicatorStyle由于某种原因,我在设置图像 URL 时仍然无法访问额外的参数。

有人知道我做错了什么吗?我尝试删除 .m 和 .h 文件并重新添加它们,但没有帮助。

0 投票
1 回答
1335 浏览

ios - Swift 中的滑块弹出框

我正在尝试为Swift. 基本上我有一个UISlider介于 0 和 255 之间的值。我想要做的是让滑块在用户按住栏时显示一个弹出框,并显示 0-100%。

研究,我发现了这个:https ://github.com/alskipp/ASValueTrackingSlider并在我的项目中实现了它。唯一的问题是它在Objective C. 这似乎是我的应用程序的完美弹出窗口,但我已将其导入到我的项目中,并在创建桥接头并将 UISlider 的类设置为ASValueTrackingSlider.

现在,当拖动滑块时,我确实会出现以下弹出框。

滑块测试

但是,根据github.com页面,我应该能够自定义弹出框等的颜色并NSNumberFormatter使用以下命令进行配置Objective C

但是,为这些执行 Swift 替代方案不起作用,因为它由于某种原因无法访问参数。我上面提到的每个成员都没有成员在场。

错误 1

有谁知道为什么我无法访问参数?我有一种感觉,我在桥接头上搞砸了!