0

I have integrated through pods using pod 'SwiftyDropbox' then when i try to execute i am getting error as SFSafariViewController has no member function using 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;
    }
user3908592
  • 43
  • 10
  • Is that the full error message you're getting? What version of Xcode you're using, and what version of the SwiftyDropbox SDK you have installed? – Greg Sep 28 '17 at 13:57
  • I Used Xcode version 8.3.3 and for swiftydropbox i am using latest version, i am even getting module not found error while i import SwiftyDropbox , can you plzz help me out – user3908592 Oct 01 '17 at 14:39

1 Answers1

1

This api : SFSafariViewController.Configuration() is only available in iOS 11, so it will not compile with Xcode version 8.3.3

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

You can upgrade the Xcode version to Xcode 9 or you can use an older version of SwiftyDropbox. To do this use this line in your Podfile:

pod 'SwiftyDropbox', '~> 4.1.2' 
Ralph
  • 716
  • 5
  • 9
  • i integrated pod 'SwiftyDropbox', '~> 4.1.2' getting error no such module SwiftyDropbox – user3908592 Oct 08 '17 at 07:39
  • https://github.com/dropbox/PhotoWatch When i try the sample i am not getting any error but when i immplement it using pod 'SwiftyDropbox', '~> 4.1.2' i am getting error as no module found error. – user3908592 Oct 08 '17 at 08:26
  • So you have overcome the first issue. This is a different problem than originally asked. To solve the "no such module" error try the answers in this question: https://stackoverflow.com/questions/31065447/no-such-module-when-i-use-cocoapods – Ralph Oct 08 '17 at 17:49