-1

iOS 13. The problem is shown on the screenshot.

gap under navigation item

The steps are:

  1. Open one view controller modally with page sheet style.

  2. Open another (second) view controller modally with page sheet style.

Expected: no Nav Bar bug

Actual: see screenshot

The source code is available here: https://github.com/rinat-enikeev/NavBarBug

Question: how to fix this bug? I want to present 2 view controllers modally with page sheet style.

Renatus
  • 1,123
  • 13
  • 20
  • 1
    i my opinion this is an Apple Bug. Just a proposal for solution: if you move the barButtons to the left, it works. – Chris Oct 07 '19 at 10:01

1 Answers1

0

Ok, for those who faced the same issue. The workaround is to add the following code to the viewDidLoad method:

if #available(iOS 13, *) {
    let appearance = navigationController?.navigationBar.standardAppearance.copy()
    navigationItem.standardAppearance = appearance
}
Renatus
  • 1,123
  • 13
  • 20