Emre
Emre

Reputation: 35

How to hide Navigation Bar Swift

I have navigation bar, its opening clearly when user clicked left bar button... and I want to hide it when user click outside or slide bar to left.

This is my codes for opening navigation bar:

menuViewController=storyboard?.instantiateViewController(withIdentifier: "MenuViewController") else { return }
    menuViewController.modalPresentationStyle  = .overCurrentContext
    menuViewController.transitioningDelegate=self
present(menuViewController,animated: true)

Upvotes: 0

Views: 1289

Answers (1)

Abhinav Khanduja
Abhinav Khanduja

Reputation: 116

this is the line to hide/unhide nav bar

self.navigationController?.navigationBar.isHidden = true

Upvotes: 1

Related Questions