If you’re using SwiftUI, use this package.
https://github.com/Chronos2500/CustomNavigationTitle
There is no need to worry about layout breaking because it does not directly use GeometryReader.