问题描述
我有一个包含三个级别的 SwiftUI 应用:
- 主列表(SwiftUI NavigationView)
- 二级列表(SwiftUI NavigationView)
- 一个 UIViewControllerRepresentable
在我的二级列表中
NavigationLink(destination: ARView(museum: self.museum)) {
Image(systemName: "camera.viewfinder")
})
然后在 UIViewControllerRepresentable 我有
struct ARView: UIViewControllerRepresentable {
var museum:Museum?
var work:Work?
func makeUIViewController(context: UIViewControllerRepresentableContext<ARView>) -> UIViewController {
let ARVC = ARViewController(nibName: "ARViewController",bundle: .main)
if let museum = museum {
ARVC.visitedMuseum = museum
ARVC.ARExperience = false
LoggingSystem.push(eventLog: ["event":"AR opened","museum":ARVC.visitedMuseum.name],verbose: false)
}
if let work = work {
ARVC.visitedWork = work
ARVC.VRonly = true
LoggingSystem.push(eventLog: ["event":"Work selected","work":ARVC.visitedWork.name],verbose: false)
}
return ARVC
}
func updateUIViewController(_ uiViewController: UIViewController,context: UIViewControllerRepresentableContext<ARView>) {
}
}
出现的后退按钮应该返回到二级列表,但它返回到主列表。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)