Assumption: I assume your have embedded in UINavigationBar in your Apple iOS App inside Storyboard.
If you want to mimic Apple Safari iOS App’s behaviour of hiding navigation bar on scroll you can do it in just single line of code without any hassle.
You have to add following code in your View Controller’s viewDidAppear function where you have added UINavigationBar in storyboard: