nlarche
nlarche

Reputation: 51

IOS - Swift - UINavigationController.hidesBarsOnSwipe Error

I'm trying to hide navigation bar on swipe but i've got this error :

webView:didFinishLoadForFrame: delegate: -[UINavigationController setHidesBarsOnSwipe:]: unrecognized selector sent to instance 0x155a3a90

I'm using a webView and a navigationController.

override func viewDidLoad() {
    super.viewDidLoad()

    let requestURL = NSURL(string:"http://www.myUrl.com")

    webView.loadRequest(NSURLRequest(URL: requestURL!))

    webView.delegate = self;

    self.automaticallyAdjustsScrollViewInsets = false;        

    self.navigationController?.setNavigationBarHidden(true, animated: false)
    self.navigationController?.setToolbarHidden(true, animated: false)
    self.view.addSubview(webView)
}

func webViewDidFinishLoad(webView: UIWebView!) {        

    let url = webView.request?.URL.absoluteString

    if (url?.rangeOfString("/exportpdf") != nil ) {

        self.navigationController?.setNavigationBarHidden(false, animated: true)
        self.navigationController?.hidesBarsOnSwipe = true; // ERROR

    }

    configureScrolling(webView)
}

any idea ?

Upvotes: 0

Views: 730

Answers (1)

gabbler
gabbler

Reputation: 13766

hidesBarsOnSwipe is a property introduced in iOS8, but it is likely you are running the app in iOS7, which causes this error message.

Upvotes: 1

Related Questions