Skip to content

UINavigationController: barHideOnTapGestureRecognizer property ​

The barHideOnTapGestureRecognizer property is the gesture used by hidesBarsOnTap. Once hidesBarsOnTap is on, this gesture drives hiding and showing the navigation bar.

Value ​

A UITapGestureRecognizer, or null.

  • Read-only; assigning to it throws TypeError.
  • Every read returns the same object.
  • Its type allows null; check before using it.

With it, you can set which of it and the other gestures in the view controller takes priority, or temporarily disable it with isEnabled.

Examples ​

js
const nav = new UINavigationController(new UIViewController());
nav.hidesBarsOnTap = true;
console.log(nav.barHideOnTapGestureRecognizer instanceof UITapGestureRecognizer);

Result: Prints true.

Corresponding iOS API ​

UINavigationController.barHideOnTapGestureRecognizer.

See also ​