【问题标题】:When i integrate dropbox with pods by using pod i am getting error as SFSafariViewController has no member function using Swift 3当我使用 pod 将 Dropbox 与 pod 集成时,我收到错误,因为 SFSafariViewController 没有使用 Swift 3 的成员函数
【发布时间】:2018-03-09 15:44:25
【问题描述】:

我已经使用 pod 'SwiftyDropbox' 通过 pod 进行集成,然后当我尝试执行时出现错误,因为 SFSafariViewController 没有使用 Swift 3 的成员函数

open class MobileSafariViewController: SFSafariViewController, SFSafariViewControllerDelegate {
    var cancelHandler: (() -> Void) = {}

    public init(url: URL, cancelHandler: @escaping (() -> Void)) {
        if #available(iOS 11.0, *) {
            let config = SFSafariViewController.Configuration()
// (here i am getting error as type SFSafariViewController has no member function)
            config.entersReaderIfAvailable = false
            super.init(url: url, configuration: config)
        } else {
            super.init(url: url, entersReaderIfAvailable: false)
        }

        self.cancelHandler = cancelHandler
        self.delegate = self;
    }

【问题讨论】:

  • 这是您收到的完整错误消息吗?您使用的是什么版本的 Xcode,以及您安装的 SwiftyDropbox SDK 版本是什么?
  • 我使用的是 Xcode 8.3.3 版,而我使用的是最新版本的 swiftydropbox,我什至在导入 SwiftyDropbox 时遇到模块未找到错误,请您帮帮我

标签: ios objective-c iphone swift3 dropbox-api


【解决方案1】:

此 api :SFSafariViewController.Configuration() 仅适用于 iOS 11,因此无法与 Xcode 8.3.3 版本一起编译

https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller.configuration

您可以将 Xcode 版本升级到 Xcode 9,也可以使用旧版本的 SwiftyDropbox。 为此,请在您的 Podfile 中使用这一行:

pod 'SwiftyDropbox', '~> 4.1.2' 

【讨论】:

  • 我集成了 pod 'SwiftyDropbox', '~> 4.1.2' 出现错误没有这样的模块 SwiftyDropbox
  • github.com/dropbox/PhotoWatch 当我尝试示例时,我没有收到任何错误,但是当我使用 pod 'SwiftyDropbox', '~> 4.1.2' 实现它时,我收到错误,因为没有找到模块错误。
  • 所以你已经克服了第一个问题。这是一个与最初提出的不同的问题。要解决“没有这样的模块”错误,请尝试以下问题的答案:stackoverflow.com/questions/31065447/…
猜你喜欢
  • 2018-01-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-25
  • 2018-10-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多