Xcode12.x开发环境中,用户在点击SwiftUI列表项进行导航跳转后,当回退到父视图时,Xcode控制台会有提示:
[Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty, disconnected UIBarButtonItem to fulfill the non-null contract.
该列表往往包含在一个复杂的层级结构中。
解决办法是,在最外层的NavigationView上添加如下修改器:
NavigationView { ...} .