/** 1 Hide Navigation Bar-simple-*/
Self.navigationController.hidesBarsOnSwipe = YES;
/** 2 Hide navigation bar-do not slide away with TableView */
-(void) Scrollviewdidscroll: (Uiscrollview *) ScrollView {
ScrollView already have a drag gesture, get the ScrollView's drag gesture directly
Uipangesturerecognizer *pan = Scrollview.pangesturerecognizer;
Get to drag the speed >0 down drag <0 up drag
CGFloat velocity = [Pan velocityinview:scrollview].y;
if (velocity <-5) {
Drag up to hide the navigation bar
[Self.navigationcontroller Setnavigationbarhidden:yes Animated:yes];
}else if (Velocity > 5) {
Drag down to display the navigation bar
[Self.navigationcontroller Setnavigationbarhidden:no Animated:yes];
}else if (velocity = = 0) {
Stop dragging
// }
//}
/** 3 hidden navigation bar-gesture disengagement (acceleration) disappears/appears */
-(void) scrollviewwillenddragging: (Uiscrollview *) ScrollView withvelocity: (cgpoint) Velocity targetcontentoffset :(inout Cgpoint *) Targetcontentoffset {
if (Velocity.y > 0.0) {
[Self.navigationcontroller Setnavigationbarhidden:yes Animated:yes];
} else if (Velocity.y < 0.0) {
[Self.navigationcontroller Setnavigationbarhidden:no Animated:yes];
// }
//}
IOS Slide Hide Navigation bar-three ways