- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在我的 swift 项目中使用 SimplePing
。当我尝试这样做时(受此 example 的第二个快速回答的启发),我收到此错误 Use of undeclared type "SimplePing"
和 Use of undeclared type "SimplePingDelegate"
。我没有找到 SimplePing 的 pod,而且它在 iOS 中默认不存在。
如何导入?
最佳答案
SimplePing 不是内置库,目前没有可用的 pod。如果您想使用该库,请继续从 Apple 下载 SimplePing.h
和 SimplePing.m
只需将其拖放到您的项目中即可。
由于您的项目是用 Swift
编写的,而库是在 Objective C
中,因此您需要使用桥接 header 将库公开给您的 swift 类。
您可以在以下位置阅读更多相关信息:Objective C & Swift in Same Project
关于ios - 使用未声明的类型 "SimplePing",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39656796/
我需要一个简单的 iPhone pinger。所以我尝试获取 SimplePing example在 iPhone 上运行。但是当我像示例中那样初始化 pinger 时,主运行循环不处理 Simple
我想在我的 swift 项目中使用 SimplePing。当我尝试这样做时(受此 example 的第二个快速回答的启发),我收到此错误 Use of undeclared type "SimpleP
我正在尝试使用此解决方案,iOS SimplePing delegates , 为我的 SimplePing 实现创建超时,但它不起作用。 SimplePing 库中没有内置任何内容来完成此操作。 我
我正在使用 SimplePing 来获取我的 swift 应用程序中的延迟,但我没有得到任何结果。 这是从 SO 中的示例中提取的代码: import Foundation public typeal
以下问题: 我实现了一个 Ping 对象: @interface PingTest : NSObject @property (strong, nonatomic) SimplePing* ping
我正在使用SimplePing来自 Apple 的示例,用于 ping 到成功收到框架委托(delegate)响应的主机 func simplePing(pinger: SimplePing!, d
我是一名优秀的程序员,十分优秀!